-
Notifications
You must be signed in to change notification settings - Fork 162
Description
Environment Details:
- Operating System: macOS (Observed on Monterey and Ventura)
- NUnit Console Runner Versions: 3.21.0 - 3.22.0
- Mono Version: Mono JIT compiler version 6.12.0.188
- Target Framework: net8.0
- Last Working Version: NUnit Console Runner 3.20.2
Description of the Issue
When attempting to run tests using the NUnit Console Runner (nunit3-console.exe) on macOS with Mono for versions 3.21.0 and 3.22.0, the following error occurs:
Errors, Failures and Warnings
1) Error : /path/to/test/project/bin/Debug/net8.0/test-project.dll
System.ArgumentException : The netcore-8.0 framework is not available for X86=False.
Available frameworks: mono-4.0
--ArgumentException: The netcore-8.0 framework is not available for X86=False.
Available frameworks: mono-4.0
at NUnit.Engine.Services.TestAgency.GetAgent (NUnit.Engine.TestPackage package) [0x000ce]
at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunnerIfNeeded () [0x0003d]
at NUnit.Engine.Runners.ProcessRunner.RunTests (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x0001f]
The tests fail to execute, and no test results are generated. The same command works correctly when using version 3.20.2 of the NUnit Console Runner. This issue appears to affect all versions from 3.21.0 to 3.22.0.
Steps to Reproduce
- Install Mono version 6.12.0.188 on macOS.
- Install NUnit Console Runner via NuGet (version 3.22.0 or 3.21.0).
- Create a test project targeting net8.0 or another supported framework.
- Compile the test project.
- Run the following command:
mono /path/to/nunit-console.exe \
--labels=Before --out=TestResult.txt \
"--result=TestResult.xml;format=nunit2" \
./test-project.csproj --trace=Verbose
Observe the error message:
System.ArgumentException : The netcore-8.0 framework is not available for X86=False.
Available frameworks: mono-4.0
Expected Behavior
The NUnit Console Runner should recognize the target framework (net8.0) and successfully execute tests on macOS using Mono, as it did in version 3.20.2.
Actual Behavior:
The NUnit Console Runner fails with an ArgumentException, stating that the net8.0 framework is not available, even though Mono is installed and configured correctly.
Additional Details:
This issue does not occur with version 3.20.2 of the NUnit Console Runner. The same command works as expected, executing tests and generating results without errors.
The issue persists across multiple macOS versions and Mono installations.
The error suggests that the Console Runner is only recognizing mono-4.0 as the available framework, but net8.0 is not supported.
Workaround
To temporarily address this issue:
Downgrade to NUnit Console Runner version 3.20.2, which works correctly on macOS.
Alternatively, use the .NET CLI (dotnet test) to execute tests targeting modern frameworks like net8.0.
Request
Please investigate why versions 3.21.0 and later fail to recognize net8.0 as a valid framework on macOS when using Mono. It would be helpful to restore compatibility or provide guidance on supported configurations.
Supporting Information
Command Output (Version 3.22.0):
Errors, Failures and Warnings
1) Error : /path/to/test/project/bin/Debug/net8.0/test-project.dll
System.ArgumentException : The netcore-8.0 framework is not available for X86=False.
Available frameworks: mono-4.0
Command Output (Version 3.20.2):
Tests run successfully, and results are generated as expected.