Sdk: dotnet test should have a --runtime option for consistency with other commands.

Created on 29 Jun 2018  路  7Comments  路  Source: dotnet/sdk

Steps to reproduce

First dotnet build -r linux-x64
So xxx.dll file will generate to /bin/Release/netcoreapp2.1/linux-x64/ folder.
Then dotnet test --no-build
Will get a error like this

The test source file "/bin/Release/netcoreapp2.1/xxx.dll" provided was not found.

how to solve it?

In PR

Most helpful comment

Hi @Rwing. Thanks again for reporting this issue. I've made a fix to 2.2.100 (a future version of the .NET Core SDK) that will add the --runtime option to dotnet test. As such, I'm closing this issue. Please reopen if you have any questions or concerns. Thanks!

All 7 comments

Hi @Rwing,

The dotnet test command doesn't have a corresponding --runtime option.

However, you may manually pass down a RuntimeIdentifier via a global property:

dotnet test --no-build -p:RuntimeIdentifier=linux-x64

That should cause the tests to run from the previous RID-specific build.

I'm going to close this issue for now. Please re-open if you have any further questions or concerns. Thank you!

Thank you. It's solved my problem.
But I still think add a --runtime option to dotnet test command is a better way.

I agree. I would like to make these options consistent between the "implicit restoring" and "implicit building" commands. Unfortunately, the test command already has -r mean something else (results directory).

Still, that doesn't mean we couldn't add --runtime. Let's re-activate this and make this about having dotnet test add --runtime for consistency.

Hi @Rwing. Thanks again for reporting this issue. I've made a fix to 2.2.100 (a future version of the .NET Core SDK) that will add the --runtime option to dotnet test. As such, I'm closing this issue. Please reopen if you have any questions or concerns. Thanks!

@peterhuene --runtime have not been added to documentation (in fact, latest dotnet testdocumentation is for 2.1 version)

Hi @MuiBienCarlota. Unfortunately, I no longer work on .NET. Do you mean the command line help documentation or the online documentation?

@mairaw - is there 3.1, 3.0, or 2.2 documentation available for dotnet test?

@peterhuene It was missing on online documentation (https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=netcore21).

Was this page helpful?
0 / 5 - 0 ratings