formulahendry / formulahendry/vscode-dotnet-test-explorer

Test results not captured when multiple xUnit projects have been discovered

Open
#284 3 comments 0 reactions 0 assignees View on GitHub
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

![image](https://user-images.githubusercontent.com/795800/89564037-b4aad580-d81c-11ea-884d-3d27f79ba499.png)

### Test explorer after running all tests

![image](https://user-images.githubusercontent.com/795800/89564132-d5732b00-d81c-11ea-8a0e-506a69616400.png)

### 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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.