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

Azure DevOps Test task in pipeline recognizes too many projects if configured as documentation says #2129

Closed
MichalLechowski opened this issue Aug 4, 2020 · 0 comments

Comments

@MichalLechowski
Copy link

MichalLechowski commented Aug 4, 2020

This probably concerns Azure DevOps pipeline but only for Core 3.x since I have been successfully using the documentation config for Core 2.x solution.
The problem is with test task configuration for xunit to run tests in the pipeline.
The basic stuff is:

  1. .NET Core Test task
  2. Task V2
  3. Publish test results and code coverage - checked

The documentation says to configure it like that:

**\bin\$(BuildConfiguration)\**\*test*.dll
!**\obj\**
!**\xunit.runner.visualstudio.testadapter.dll
!**\xunit.runner.visualstudio.dotnetcore.testadapter.dll 

If I do that, it recognizes way to many projects as test projects and fails e.g.:
D:\a\1\s\IntegrationTests\bin\Release\netcoreapp3.1\Microsoft.TestPlatform.CommunicationUtilities.dll
D:\a\1\s\IntegrationTests\bin\Release\netcoreapp3.1\Microsoft.TestPlatform.CoreUtilities.dll
D:\a\1\s\IntegrationTests\bin\Release\netcoreapp3.1\Microsoft.TestPlatform.CrossPlatEngine.dll
D:\a\1\s\IntegrationTests\bin\Release\netcoreapp3.1\Microsoft.TestPlatform.PlatformAbstractions.dll
D:\a\1\s\IntegrationTests\bin\Release\netcoreapp3.1\Microsoft.TestPlatform.Utilities.dll
D:\a\1\s\IntegrationTests\bin\Release\netcoreapp3.1\cs\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
D:\a\1\s\IntegrationTests\bin\Release\netcoreapp3.1\cs\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
D:\a\1\s\UnitsTests\bin\Release\netcoreapp3.1\Microsoft.AspNetCore.Mvc.Testing.dll

and so on, there is plenty like these and obviously every one of them ends with:

Test Run Aborted.
##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1

The workaround is config like this:

**\tests\**\bin\$(BuildConfiguration)\**\*tests*.dll
!**\tests\**\obj\**
!**\tests\**\xunit.runner.visualstudio.testadapter.dll
!**\tests\**\xunit.runner.visualstudio.dotnetcore.testadapter.dll
!**\tests\**\testhost.dll

just putting all your test projects within tests folder then the problem cease to exist.

Am I missing something here? Is that a bug you are not aware of or is it how it's supposed to work for Core 3.x? The very same configuration works fine for Core 2.x, as mentioned before. Obviously the xUnit dlls are recognized just fine and all the tests pass but all the other dlls that shouldn't be recognized as tests fail hence the whole task fails.

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

No branches or pull requests

2 participants