natemcmaster / xunit-cli

A global .NET Core command line tool for running XUnit tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support netcoreapp3.1

AlexSugak opened this issue · comments

Hi!

Is there a way to run xunit console runner with .net core 3.1 projects? I guess it really depends on underlying xunit.console.runner package. But maybe I am missing some flag/config?

This is what I'm getting when trying to run with 3.1 test project (dotnet test works OK):

It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.0.0' was not found.
  - The following frameworks were found:
      3.1.3 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

I remember from before that xunit console runner was ~1-2 sec faster than dotnet test. So wanted to give it a try.

Thank you for the prompt reply!

Still getting the same error with 0.1.8. Does it work for you on a new (dotnet new xunit) project targeting netcoreapp3.1 ?

Оh, my bad. I had to specify a target dll. This works:
dotnet xunit ./bin/Debug/netcoreapp3.1/test.dll

Should it auto-detect a dll path when run inside a project folder though?

Should it auto-detect a dll path when run inside a project folder though?

No. This is intentionally designed to have the same usage as https://xunit.net/docs/getting-started/netfx/visual-studio#run-tests. This is not a replacement for dotnet-xunit (which the xunit team deprecated). If you want interaction with the project system (like auto-detecting .dll's), use dotnet test.

Makes sense.

dotnet test is ~2 sec slower though :(