formulahendry / formulahendry/vscode-dotnet-test-explorer

Running induvidual tests doesn't work - Could not find a matching test directory for test

Open
#355 5 comments 4 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
208
Forks
93
PR merge metrics
No merged PRs in 30d

Description

Hello,
I have Unity project with NUnit tests. If I open Testing tab, there are not tests visible:
![image](https://user-images.githubusercontent.com/4307038/156725489-eb14cca9-7c94-42b5-a39e-818e49ecba64.png)

console output:
`
Starting extension
Finding projects for pattern /home/pavel/NetBeansProjects/imperium/Assets/Tests/*/Tests.*.csproj
Found 2 matches for pattern in folder /home/pavel/NetBeansProjects/imperium
Evaluating match /home/pavel/NetBeansProjects/imperium/Assets/Tests/core/Tests.Core.csproj
Adding directory /home/pavel/NetBeansProjects/imperium/Assets/Tests/core
Evaluating match /home/pavel/NetBeansProjects/imperium/Assets/Tests/def/Tests.Def.csproj
Adding directory /home/pavel/NetBeansProjects/imperium/Assets/Tests/def
Executing dotnet test -t -v=q in /home/pavel/NetBeansProjects/imperium/Assets/Tests/core
`

If I click run all button, all tests runs just fine:
![image](https://user-images.githubusercontent.com/4307038/156725711-4ea09db7-e239-4176-9f1a-99f649449a0e.png)

console output:
`
Executing dotnet build in /home/pavel/NetBeansProjects/imperium/Assets/Tests/core
Executing dotnet test --no-build --logger "trx;LogFileName=/tmp/test-explorer-apqaEd/0.trx" in /home/pavel/NetBeansProjects/imperium/Assets/Tests/core
Process 11783 started
Test run for /home/pavel/NetBeansProjects/imperium/Temp/tests.core/Bin/Debug/net6.0/tests.core.dll (.NETCoreApp,Version=v6.0)
Microsoft (R) Test Execution Command Line Tool Version 17.1.0
Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Results File: /tmp/test-explorer-apqaEd/0.trx

Passed! - Failed: 0, Passed: 12, Skipped: 0, Total: 12, Duration: 727 ms - /home/pavel/NetBeansProjects/imperium/Temp/tests.core/Bin/Debug/net6.0/tests.core.dll (net6.0)

Process 11783 finished
Executing dotnet build in /home/pavel/NetBeansProjects/imperium/Assets/Tests/def
Executing dotnet test --no-build --logger "trx;LogFileName=/tmp/test-explorer-apqaEd/1.trx" in /home/pavel/NetBeansProjects/imperium/Assets/Tests/def
Process 11882 started
Test run for /home/pavel/NetBeansProjects/imperium/Temp/tests.def/Bin/Debug/net6.0/tests.def.dll (.NETCoreApp,Version=v6.0)
Microsoft (R) Test Execution Command Line Tool Version 17.1.0
Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Results File: /tmp/test-explorer-apqaEd/1.trx

Passed! - Failed: 0, Passed: 30, Skipped: 0, Total: 30, Duration: 354 ms - /home/pavel/NetBeansProjects/imperium/Temp/tests.def/Bin/Debug/net6.0/tests.def.dll (net6.0)

Process 11882 finished
`

**If I run individuals test or test group, I will get error:**
`
[WARNING] Could not find a matching test directory for test imperium.tests.core.ConfigLoaderTest
`

I've tried to find more info what does this mean. How and where I can set "matching" test directory. But I've found nothing.

I don't know if problem is in project settings, VSCode settings, test explorer settings, vsocde bug, test explorer bug, dotnet bug or something else.

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.