formulahendry / formulahendry/vscode-dotnet-test-explorer

No tests found, even though everything seems fine

Open
#302 15 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
208
Forks
93
PR merge metrics
No merged PRs in 30d

Description

The test explorer doesn't seem to be able to locate any tests, even though there are no errors reported and everything works on the command line. When I try to refresh the list of tests, I see the following in the debug log:

```
Finding projects for pattern c:/Users\\source\Library-Test/**/*.Tests.csproj
Found 1 matches for pattern in folder c:\Users\\source\Library-Test
Evaluating match c:/Users//source/Library-Test/test/Library.Tests/Library.Tests.csproj
Adding directory c:/Users//source/Library-Test/test/Library.Tests
Executing dotnet test -t -v=q in c:/Users//source/Library-Test/test/Library.Tests
```

If I run `dotnet test -t -v=q` in that folder, it works fine and I get a list of tests back:

```
Test run for C:\Users\\source\Library-Test\test\Library.Tests\bin\Debug\net5.0\Library.Tests.dll (.NETCoreApp,Version=v5.0)
Microsoft (R) Test Execution Command Line Tool Version 16.8.3
Copyright (c) Microsoft Corporation. All rights reserved.

The following Tests are available:
TestOne
TestTwo
TestThree
```

Looking at the code in testDiscovery.ts, I then tried running `dotnet vstest C:\Users\\source\Library-Test\test\Library.Tests\bin\Debug\net5.0\Library.Tests.dll /ListFullyQualifiedTests /ListTestsTargetPath:"output.txt"` and I get a good list in output.txt, so I'm not sure why this extension can't display them. Everything works fine in Visual Studio 2019; I'm trying to use Visual Studio Code instead so I can get code coverage feedback. Are there any special criteria this extension uses to identify tests? Is there some way to debug what's going on?

SDK version: 5.0.103
Unit test framework: NUnit 3.13.1
All projects are targeting net5.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.