formulahendry / formulahendry/vscode-dotnet-test-explorer
Test results not captured when multiple xUnit projects have been discovered
- Dominant language
- TypeScript
- Stars
- 208
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I have multiple test projects open and the results are not detected.
### Versions
```
```
### Test explorer after running a single test project

### Test explorer after running all tests

### Output (running one test project)
#### .NET Test Explorer
```
Test run for DeviceBackend.TlvCodec.Tests.TlvCodecTests
Executing dotnet build in f:/DEV/cur8/DeviceBackend/
Executing dotnet test --no-build --logger "trx;LogFileName=C:\Users\mikae\AppData\Local\Temp\test-explorer-nWOeOq\0.trx" --filter "FullyQualifiedName~DeviceBackend.TlvCodec.Tests.TlvCodecTests" in f:/DEV/cur8/DeviceBackend/
Process 17456 started
Process 17456 finished
```
#### Test Explorer
```
Test run for f:\DEV\cur8\DeviceBackend\tests\DeviceBackend.TlvCodec.Tests\bin\Debug\netcoreapp3.1\DeviceBackend.TlvCodec.Tests.dll(.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 16.6.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Test run for f:\DEV\cur8\DeviceBackend\tests\DeviceBackend.Functions.Tests\bin\Debug\netcoreapp3.1\DeviceBackend.Functions.Tests.dll(.NETCoreApp,Version=v3.1)
Test run for f:\DEV\cur8\DeviceBackend\tests\DeviceBackend.Recording.Tests\bin\Debug\netcoreapp3.1\DeviceBackend.Recording.Tests.dll(.NETCoreApp,Version=v3.1)
Test run for f:\DEV\cur8\DeviceBackend\tests\DeviceBackend.Dal.Tests\bin\Debug\netcoreapp3.1\DeviceBackend.Dal.Tests.dll(.NETCoreApp,Version=v3.1)
A total of 1 test files matched the specified pattern.
Microsoft (R) Test Execution Command Line Tool Version 16.6.0
Copyright (c) Microsoft Corporation. All rights reserved.
Microsoft (R) Test Execution Command Line Tool Version 16.6.0
Copyright (c) Microsoft Corporation. All rights reserved.
Microsoft (R) Test Execution Command Line Tool Version 16.6.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Starting test execution, please wait...
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
A total of 1 test files matched the specified pattern.
A total of 1 test files matched the specified pattern.
X DeviceBackend.TlvCodec.Tests.TlvCodecTests.ParseValidHeaderNoSizeNoDepth [3ms]
Error Message:
Assert.Equal() Failure
Expected: 1
Actual: 5
Stack Trace:
at DeviceBackend.TlvCodec.Tests.TlvCodecTests.ParseValidHeaderNoSizeNoDepth() in F:\DEV\cur8\DeviceBackend\tests\DeviceBackend.TlvCodec.Tests\TlvCodecTests.cs:line 17
Results File: C:\Users\mikae\AppData\Local\Temp\test-explorer-nWOeOq\0.trx
Total tests: 3
Passed: 2
Failed: 1
Total time: 1,2451 Seconds
No test matches the given testcase filter `FullyQualifiedName~DeviceBackend.TlvCodec.Tests.TlvCodecTests` in f:\DEV\cur8\DeviceBackend\tests\DeviceBackend.Recording.Tests\bin\Debug\netcoreapp3.1\DeviceBackend.Recording.Tests.dll
WARNING: Overwriting results file: C:\Users\mikae\AppData\Local\Temp\test-explorer-nWOeOq\0.trx
Results File: C:\Users\mikae\AppData\Local\Temp\test-explorer-nWOeOq\0.trx
No test matches the given testcase filter `FullyQualifiedName~DeviceBackend.TlvCodec.Tests.TlvCodecTests` in f:\DEV\cur8\DeviceBackend\tests\DeviceBackend.Dal.Tests\bin\Debug\netcoreapp3.1\DeviceBackend.Dal.Tests.dll
WARNING: Overwriting results file: C:\Users\mikae\AppData\Local\Temp\test-explorer-nWOeOq\0.trx
Results File: C:\Users\mikae\AppData\Local\Temp\test-explorer-nWOeOq\0.trx
No test matches the given testcase filter `FullyQualifiedName~DeviceBackend.TlvCodec.Tests.TlvCodecTests` in f:\DEV\cur8\DeviceBackend\tests\DeviceBackend.Functions.Tests\bin\Debug\netcoreapp3.1\DeviceBackend.Functions.Tests.dll
WARNING: Overwriting results file: C:\Users\mikae\AppData\Local\Temp\test-explorer-nWOeOq\0.trx
Results File: C:\Users\mikae\AppData\Local\Temp\test-explorer-nWOeOq\0.trx
```
My assumption is that the last couple of lines of that log is the reason why it fails:
```
No test matches the given testcase filter `FullyQualifiedName~DeviceBackend.TlvCodec.Tests.TlvCodecTests` in f:\DEV\cur8\DeviceBackend\tests\DeviceBackend.Functions.Tests\bin\Debug\netcoreapp3.1\DeviceBackend.Functions.Tests.dll
WARNING: Overwriting results file: C:\Users\mikae\AppData\Local\Temp\test-explorer-nWOeOq\0.trx
Results File: C:\Users\mikae\AppData\Local\Temp\test-explorer-nWOeOq\0.trx
```
The last run project `DeviceBackend.Functions.Tests` does not contain any tests which match the expression (which is correct) so I assume it writes an empty file.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.