-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Running tests tries to run .NET Framework tests with mono on non-Windows #81395
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/runtime-infrastructure Issue DetailsWhen I run tests on my Mac now, it seems to be trying to run .NET Framework tests with mono. For example, running this command on my Mac ./dotnet.sh test src/libraries/System.Security.Cryptography.Pkcs/tests It will first run all of the .NET (Core) tests and everything passes. Great. Then it proceeds to run the .NET Framework test, and gives this error:
Even if I install mono, the tests will absolutely crash and burn since most of the project I work on that target .NET Framework assume they are running on Windows. Running S.S.C.Pkcs on macOS with Mono with the .NET Framework target has hundreds of failures. Was there a change that introduced this recently, and, was it intentional? Or did something change in my environment that's making it try to do this?
|
Probably regressed with dotnet/arcade@e82404f. I will take a look in the next days. |
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsWhen I run tests on my Mac now, it seems to be trying to run .NET Framework tests with mono. For example, running this command on my Mac ./dotnet.sh test src/libraries/System.Security.Cryptography.Pkcs/tests It will first run all of the .NET (Core) tests and everything passes. Great. Then it proceeds to run the .NET Framework test, and gives this error:
Even if I install mono, the tests will absolutely crash and burn since most of the project I work on that target .NET Framework assume they are running on Windows. Running S.S.C.Pkcs on macOS with Mono with the .NET Framework target has hundreds of failures. Was there a change that introduced this recently, and, was it intentional? Or did something change in my environment that's making it try to do this?
|
@ViktorHofer Do you happen to have any updates on this? I think my real question is: what's the suggested way to exclude .NET Framework tests? AFAIK exactly one argument is expected for the |
I've been doing something like this for now.
I can't exclude .NET Framework, but I can run a particular framework, which works for my purposes. |
I had to put this on the back-burner, unfortunately. We could either change this directly only for runtime or move this issue over into the vstest repository and ask for a switch to not invoke Mono when testing .NET Framework. These days, running .NET Framework via Mono on Unix platforms is a niche scenario. |
Looks like is there since 2017 and for what I recall we didn't to any update to this part of the resolution alg(netfx) @nohwnd I think you weren't here at that time too but do you have some information about? Have you seen issue like that in past? Do you think it's safe to remove? |
Just to clarify, I wasn't asking for your team to make a breaking change and remove VSTest's .NET Framework Mono support (which could still be done, but might require more discussion). I was asking if it would be possible to expose a flag when invoking |
It would be great if this could be handled on the msbuild level, ideally we should run all the dlls that you give us to run, and in this case we get both .net and .net framework dlls because the build that happens under dotnet test (when used with csproj or sln) is building all the multi-targets. Implementing this on vstest level would mean adding a tfm filter, which I don't think is impossible, but might be a bit confusing to use, and because we historically succeed when stuff is not run, we should have do it here as well and it would make ignoring your whole test-suite quite easy. E.g. naming the allowed frameworks --framework-filter: dotnet test --framework net8.0 --framework-filter net6.0, net7.0 This would filter your dlls only to net6.0. and net7.0 dlls from run that targets only net8.0, so tests from 0 assemblies are run. We can warn about --framework and --framework-filter not having any intersection, and fail, but then it is not consistent with many of the other parameters that allow you to get a warning and continue. |
We'd try to use Mono to run them but most of the tests assume Windows when targetting net4x so they don't work anyway and you'd need to remember to pass the `-f net9.0` TFM filter. Instead just skip them on non-Windows platforms. Fixes dotnet#81395
* Don't run net4x tests with Mono on non-Windows We'd try to use Mono to run them but most of the tests assume Windows when targetting net4x so they don't work anyway and you'd need to remember to pass the `-f net9.0` TFM filter. Instead just skip them on non-Windows platforms. Fixes #81395 * Make AdditionalProperties more resilient against changes * Use TargetOS instead of OS so it also works for building e.g. Browser targets on Windows * Move logic to arcade Microsoft.DotNet.Build.Tasks * Update eng/testing/outerBuild.targets Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com> --------- Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
@akoeplinger @ViktorHofer Thanks for fixing this! Given that .NET 8 is an LTS, is there any chance this can be backported to .NET 8? |
@Bartleby2718 #98767 only affects development inside of the dotnet/runtime repository so it's not likely we'll backport it. |
When I run tests on my Mac now, it seems to be trying to run .NET Framework tests with mono. For example, running this command on my Mac
./dotnet.sh test src/libraries/System.Security.Cryptography.Pkcs/tests
It will first run all of the .NET (Core) tests and everything passes. Great. Then it proceeds to run the .NET Framework test, and gives this error:
Even if I install mono, the tests will absolutely crash and burn since most of the project I work on that target .NET Framework assume they are running on Windows. Running S.S.C.Pkcs on macOS with Mono with the .NET Framework target has hundreds of failures.
Was there a change that introduced this recently, and, was it intentional? Or did something change in my environment that's making it try to do this?
The text was updated successfully, but these errors were encountered: