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.

Test Explorer is finding tests, but not running them after upgrading to NUnit3TestAdapter v4.3.0

See original GitHub issue

NUnit: v3.13.3 NUnit3TestAdapter: v4.3.0 Visual Studio Professional 2019: v16.11.20 Target Framework Version: v4.5

I’m running Visual Studio Professional 2019 and have many NUnit tests in my project. With v4.2.1 of the NUnit3TesetAdapter installed, the Test Explorer is able to find and run all my tests as expected.

However, a few days ago I updated my NUnit3TestAdapter nuget package from 4.2.1 to 4.3.0 and now my Test Explorer does not run any of the tests. It throws no errors and has no problem finding/displaying the tests, but whenever I try to run them, it says:

Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in 172.1 ms

I can confirm that rolling back to 4.2.1, cleaning, and rebuilding the project fixes the problem so maybe the issue is a bug in the 4.3.0 package, however I wanted to check if there is any configuration I need to do in Visual Studio to fix this.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:47 (26 by maintainers)

github_iconTop GitHub Comments

2reactions
OsirisTerjecommented, Nov 19, 2022
2reactions
smkanadlcommented, Nov 2, 2022

I have a similar issue with some interesting Test log output:

Test project *** does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project. It’s recommended to reference NuGet test adapters in each test project in the solution. NUnit Adapter 4.3.0.0: Test discovery starting Exception System.UnauthorizedAccessException, Exception thrown discovering tests in ****.dll Access to the path ‘C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\InternalTrace.30660.log’ is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share) at NUnit.Engine.Internal.InternalTraceWriter…ctor(String logPath) at NUnit.Engine.Internal.InternalTrace.Initialize(String logName, InternalTraceLevel level) at NUnit.Engine.TestEngine.Initialize() at NUnit.Engine.TestEngine.GetRunner(TestPackage package) at NUnit.VisualStudio.TestAdapter.NUnit3TestDiscoverer.DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger messageLogger, ITestCaseDiscoverySink discoverySink) in D:\repos\NUnit\nunit3-vs-adapter\src\NUnitTestAdapter\NUnit3TestDiscoverer.cs:line 82 NUnit Adapter 4.3.0.0: Test discovery complete No test is available in ***.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

The test project is a multi-targeted C# project with net48, netcoreapp3.1 and net6.0. Executing the test for netcoreapp3.1 and net6.0 works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test Explorer is finding tests, but not running them after ...
Test Explorer is finding tests, but not running them after upgrading to NUnit3TestAdapter v4. 3.0. I can confirm that rolling back to 4.2....
Read more >
nunit tests discovered but not running
Hi, I have NUnit 3.12 and Nunit3TestAdaptor 3.15.1 installed, using VS2019 community. I am able to discover the tests in the test explorer...
Read more >
Adapter V4 Release Notes
This fix applies to test projects where all tests are excluded by a test item filter. Previously, as of v4.2.0, all tests were...
Read more >
Run unit tests with Test Explorer - Visual Studio (Windows)
If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl...
Read more >
NUnit tests is not found or do not run in Visual Studio's ...
The Visual Studio Test Explorer says that it can't find any tests, even though I can see that it found 306 tests? And...
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