dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

dotnet test -t do not list right result with mstest/nunit #11503

Closed athinboy closed 4 years ago

athinboy commented 4 years ago

The command (dotnet test -t) just list the method name ,rather than all qualified name .Due to this ,the "vscode-dotnet-test-explorer" (https://github.com/formulahendry/vscode-dotnet-test-explorer) can not work .

This is result of mstest/nunit:

Microsoft (R) Test Execution Command Line Tool Version 16.5.0 Copyright (c) Microsoft Corporation. All rights reserved. The following Tests are available: Pass Pass2 Fail SkippedTest Pass AnotherPass Fail DataTest

BUT XUNIT do work correctly: The following Tests are available: XunitTests.TestClass1.Pass XunitTests.TestClass1.PassNew XunitTests.TestClass1.AnotherPass XunitTests.TestClass1.Fail3 XunitTests.TestClass2.Pass XunitTests.TestClass2.Pass2 XunitTests.TestClass2.Fail

dotnet core 3.1.201 For mstest:

    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
    <PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
    <PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
    <PackageReference Include="Shouldly" Version="3.0.0" />

For nunit:

    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
    <PackageReference Include="Shouldly" Version="3.0.0" />
    <PackageReference Include="nunit" Version="3.8.1" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />

For Xunit:

    <PackageReference Include="coverlet.msbuild" Version="2.2.1" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
    <PackageReference Include="Shouldly" Version="3.0.0" />
    <PackageReference Include="xunit" Version="2.3.1" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
    <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
athinboy commented 4 years ago

@marcpopMSFT there is some test code: https://github.com/formulahendry/vscode-dotnet-test-explorer/tree/master/test

nohwnd commented 4 years ago

@marcpopMSFT we will discuss this in vstest, you can close this.

marcpopMSFT commented 4 years ago

Per Jakub's comment, closing.