question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No output or errors from nunit tests - 1.10.0-beta2

See original GitHub issue

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.4)

Product Information:
 Version:            1.0.4
 Commit SHA-1 hash:  af1e6684fd

Runtime Environment:
 OS Name:     debian
 OS Version:  8
 OS Platform: Linux
 RID:         debian.8-x64
 Base Path:   /usr/share/dotnet/sdk/1.0.4

VS Code version: C# Extension version: 1.12.1

omnisharp-vscode: 1.10.0-beta2

Steps to reproduce

Here is a repo which exactly reproduces this https://github.com/tomzo/bug-nunit-no-output-vscode

Just run

dotnet restore
dotnet test DefaultTests/DefaultTests.csproj

Then try the same in vscode by clicking on run test on one of the tests.

Expected behavior

There are tests which are failingand there is standard output printed in one of the tests.

[Test]
        public void Test1()
        {
			new Class1 ();
            Console.WriteLine("Test body running..");
        }

		[Test]
        public void Test2()
        {
            Assert.AreEqual(2,26);
        }

I would expect to see both the stdout and especially failed asserts from nunit test cases.

Actual behavior

In VsCode .NET Test Log output just counts the failed tests

NUnit Adapter 3.8.0.0: Test discovery starting
NUnit Adapter 3.8.0.0: Test discovery complete
NUnit Adapter 3.8.0.0: Test execution started
Running selected tests in /ide/work/nunit-repro/DefaultTests/bin/Debug/netcoreapp1.0/DefaultTests.dll
NUnit3TestExecutor converted 2 of 2 NUnit test cases
NUnit Adapter 3.8.0.0: Test execution complete

Total tests: 1. Passed: 0. Failed: 1. Skipped: 0

The output when running with dotnet is fine:

$ dotnet test  DefaultTests/DefaultTests.csproj 
Build started, please wait...
/usr/share/dotnet/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.targets(40,3): warning MSB4011: "/usr/share/dotnet/sdk/1.0.4/Microsoft.CSharp.targets" cannot be imported again. It was already imported at "/ide/work/nunit-repro/ExampleLib/ExampleLib.csproj (28,3)". This is most likely a build authoring error. This subsequent import will be ignored. 
Build completed.

Test run for /ide/work/nunit-repro/DefaultTests/bin/Debug/netcoreapp1.0/DefaultTests.dll(.NETCoreApp,Version=v1.0)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
NUnit Adapter 3.8.0.0: Test execution started
Running all tests in /ide/work/nunit-repro/DefaultTests/bin/Debug/netcoreapp1.0/DefaultTests.dll
NUnit3TestExecutor converted 2 of 2 NUnit test cases
NUnit Adapter 3.8.0.0: Test execution complete
Failed   Test2
Error Message:
   Expected: 2
  But was:  26

Stack Trace:
at DefaultTests.UnitTest1.Test2() in /ide/work/nunit-repro/DefaultTests/UnitTest1.cs:line 20


Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.
Test Run Failed.
Test execution time: 1.8351 Seconds

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17

github_iconTop GitHub Comments

1reaction
tomzocommented, May 15, 2017

Thanks @bernardbr Nice to see some progress on the way

1reaction
rprousecommented, May 15, 2017

This issue was moved to nunit/nunit3-vs-adapter#329

Read more comments on GitHub >

github_iconTop Results From Across the Web

No output or errors from nunit tests - 1.10.0-beta2 #329 - GitHub
This issue is moved from the OmniSharp repository, 1.10.0-beta2 refers to the C# extension for Visual Studio Code which also uses the adapter....
Read more >
Nunit - doesn't discover tests [no error-message]
It simply doesn't discover that I have tests. I right-click the test-method and the test output shows: Discover test started ------ Discover test...
Read more >
How to enable Trace and Debug output | NUnit Docs
Trace and Debug output is by default not sent to the console output, ... This is easy to do, and you can do...
Read more >
After building a project with NUnit tests, the test output pane ...
Test is discovered in the Testexplorer and source information is available on selecting the test. There are no errors in the Test output...
Read more >
Execute tests and analyze results - ReSharper - JetBrains
ReSharper's unit test runner does not allow running two or more tests with the same ID. This rarely happens in practice, but if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found