Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] dotnet test will override test output #367

Open
rsun-thoughtworks opened this issue Jul 19, 2022 · 3 comments
Open

[Bug] dotnet test will override test output #367

rsun-thoughtworks opened this issue Jul 19, 2022 · 3 comments

Comments

@rsun-thoughtworks
Copy link

Background info

I have a solution with multiple project inside it.

Action

When I execute a test within one project.

In the background, the extension is going to run a command like this

dotnet test --no-build --logger "trx;LogFileName=/Users/xx/code/result/test-explorer-K8WIVk/0.trx" --filter "FullyQualifiedName~Demo.Tests.ObjectExtensions"

Because as the extension assign the LogFileName, the dotnet test command will override the log as it process each of the projects.

Yes, each of the projects.

You can see from the output of previous command:

Test run for /Users/xxx/code/DemoManagement/DemoManagement.Api.Tests/bin/Debug/netcoreapp3.1/DemoManagement.Api.Tests.dll(.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 16.7.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.
Test run for /Users/xxx/code/DemoManagement/DemoManagement.Design.Tests/bin/Debug/netcoreapp3.1/DemoManagement.Design.Tests.dll(.NETCoreApp,Version=v3.1)
Test run for /Users/xxx/code/DemoManagement/DemoManagement.Domain.Tests/bin/Debug/netcoreapp3.1/DemoManagement.Domain.Tests.dll(.NETCoreApp,Version=v3.1)
Test run for /Users/xxx/code/DemoManagement/DemoManagement.IntegrationTests/bin/Debug/netcoreapp3.1/DemoManagement.IntegrationTests.dll(.NETCoreApp,Version=v3.1)
Test run for /Users/xxx/code/DemoManagement/DemoManagement.Application.Tests/bin/Debug/netcoreapp3.1/DemoManagement.Application.Tests.dll(.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 16.7.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Microsoft (R) Test Execution Command Line Tool Version 16.7.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Microsoft (R) Test Execution Command Line Tool Version 16.7.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Microsoft (R) Test Execution Command Line Tool Version 16.7.0
Copyright (c) Microsoft Corporation.  All rights reserved.

No test matches the given testcase filter `FullyQualifiedName~DemoManagement.Application.Tests.ObjectExtensions` in /Users/xxx/code/DemoManagement/DemoManagement.Api.Tests/bin/Debug/netcoreapp3.1/DemoManagement.Api.Tests.dll
Starting test execution, please wait...
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.
WARNING: Overwriting results file: /Users/xxx/code/result/test-explorer-K8WIVk/0.trx
Results File: /Users/xxx/code/result/test-explorer-K8WIVk/0.trx


A total of 1 test files matched the specified pattern.
No test matches the given testcase filter `FullyQualifiedName~DemoManagement.Application.Tests.ObjectExtensions` in /Users/xxx/code/DemoManagement/DemoManagement.Domain.Tests/bin/Debug/netcoreapp3.1/DemoManagement.Domain.Tests.dll
WARNING: Overwriting results file: /Users/xxx/code/result/test-explorer-K8WIVk/0.trx
Results File: /Users/xxx/code/result/test-explorer-K8WIVk/0.trx

[xUnit.net 00:00:01.15]     DemoManagement.Application.Tests.ObjectExtensions.StringExtensionTests.WhiteSpace_ShouldReturnNull_WhenCalledOnWhiteSpace [FAIL]
No test matches the given testcase filter `FullyQualifiedName~DemoManagement.Application.Tests.ObjectExtensions` in /Users/xxx/code/DemoManagement/DemoManagement.Design.Tests/bin/Debug/netcoreapp3.1/DemoManagement.Design.Tests.dll
  X DemoManagement.Application.Tests.ObjectExtensions.StringExtensionTests.WhiteSpace_ShouldReturnNull_WhenCalledOnWhiteSpace [3ms]
  Error Message:
   Assert.Null() Failure
Expected: (null)
Actual:   34
  Stack Trace:
     at DemoManagement.Application.Tests.ObjectExtensions.StringExtensionTests.WhiteSpace_ShouldReturnNull_WhenCalledOnWhiteSpace() in /Users/xxx/code/DemoManagement/DemoManagement.Application.Tests/ObjectExtensions/StringExtensionTests.cs:line 17
WARNING: Overwriting results file: /Users/xxx/code/result/test-explorer-K8WIVk/0.trx
Results File: /Users/xxx/code/result/test-explorer-K8WIVk/0.trx

Test Run Failed.
Total tests: 1
     Failed: 1
 Total time: 1.9760 Seconds
/usr/local/share/dotnet/sdk/3.1.405/Microsoft.TestPlatform.targets(32,5): error MSB4181: The "Microsoft.TestPlatform.Build.Tasks.VSTestTask" task returned false but did not log an error. [/Users/xxx/code/DemoManagement/DemoManagement.Application.Tests/DemoManagement.Application.Tests.csproj]
No test matches the given testcase filter `FullyQualifiedName~DemoManagement.Application.Tests.ObjectExtensions` in /Users/xxx/code/DemoManagement/DemoManagement.IntegrationTests/bin/Debug/netcoreapp3.1/DemoManagement.IntegrationTests.dll
WARNING: Overwriting results file: /Users/xxx/code/result/test-explorer-K8WIVk/0.trx
Results File: /Users/xxx/code/result/test-explorer-K8WIVk/0.trx

WARNING: Overwriting results file: /Users/xxx/code/result/test-explorer-K8WIVk/0.trx
Results File: /Users/xxx/code/result/test-explorer-K8WIVk/0.trx

And the result in 0.trx is the result of last project, instead of the sum of them.

@starball5
Copy link

@pabloandrade-ah
Copy link

This seems to be a problem within the dotnet test command, since this also occurs when executing the command from cli

@abatishchev
Copy link

Bump, the issue exists till this day, in late 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants