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

v3.14 fails with target framework net461 ... net48 on linux (ArgumentException: The net-4.6.1 framework is not available.), but v3.12 works well #1130

Closed
Tracked by #1258
devizer opened this issue Feb 10, 2022 · 4 comments
Assignees
Labels
Milestone

Comments

@devizer
Copy link

devizer commented Feb 10, 2022

Intro: We need nunit-console to test NET Standard Libraries on mono-only platforms such as armv6, Raspberry PI zero, etc. v3.12 did it well, but the latest v3.14 fails.

For v3.14 the output on a Linux for net4.6.1 test assembly is:

NUnit Console Runner 3.14.0 (.NET 2.0)
Copyright (c) 2021 Charlie Poole, Rob Prouse
Thursday, February 10, 2022 3:33:32 PM

Runtime Environment
   OS Version: Linux 4.4.153.0
   Runtime: .NET Framework CLR v4.0.30319.42000

Test Files
    Universe.CpuUsage.Tests.dll


Errors, Failures and Warnings

1) Error :
System.ArgumentException : The net-4.6.1 framework is not available.
Available frameworks: mono-4.0
--ArgumentException
The net-4.6.1 framework is not available.
Available frameworks: mono-4.0
  at NUnit.Engine.Services.TestAgency.GetAgent (NUnit.Engine.TestPackage package) [0x0008e] in <78bad2d45f9a4bfe96b1d2028544fabf>:0
  at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunnerIfNeeded () [0x0003d] in <78bad2d45f9a4bfe96b1d2028544fabf>:0
  at NUnit.Engine.Runners.ProcessRunner.RunTests (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x0001f] in <78bad2d45f9a4bfe96b1d2028544fabf>:0

Test Run Summary
  Overall result: Failed
  Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2022-02-10 15:33:33Z
    End time: 2022-02-10 15:33:33Z
    Duration: 0.034 seconds

Results (nunit3) saved as TestResult.xml

v3.12 works well.
How to reproduce:

NETFW=net461
work=$HOME/transient-builds/src
mkdir -p $work && cd $work
echo "git clone|pull"
test ! -d Universe.CpuUsage && git clone https://github.com/devizer/Universe.CpuUsage || true
cd Universe.CpuUsage
git reset --hard; git pull
echo "Reset target framework to [$NETFW]"
Reset-Target-Framework --framework $NETFW --language latest
echo "Restore Dependencies"
cd Universe.CpuUsage.Tests
msbuild /t:Restore -v:m
echo "Build Release for Universe.CpuUsage.Tests"
msbuild /t:Build /p:Configuration=Release -v:m
cd bin/Release/$NETFW
echo "Run Integration Tests"
nunit3-console --workers=1 Universe.CpuUsage.Tests.dll
echo "Successfully completed"

nunit3-console is a shell-link:
mono /...path...to...nuget..package/packages/NUnit.ConsoleRunner/tools/nunit3-console.exe "$@"
mono and msbuild: the latest from official Xamarin repo, 6.12.0.122
OS Ubuntu 18.04 LTS (actually Linux version doesn't matter)

Below just references how to simplify reproduction step
Reset-Target-Framework scripts above resets Targetframwork[s] to specific version for csproj-files. here is it: https://github.com/devizer/test-and-build/blob/master/lab/permanent-scripts/Reset-Target-Framework.sh

v3.12 can be installed via snapshot.gz using shared script:
https://github.com/devizer/glist/blob/master/bin/net-test-runners.sh

The latest version of nunit-console can be installed via nuget using another shared script
https://github.com/devizer/test-and-build/blob/master/lab/NET-TEST-RUNNERS-build.sh
As of now, it installs v3.14

@suchithm
Copy link

3.14 fails and even 3.15 version of NUnit.ConsoleRunner is throwing the same error

System.ArgumentException : The net-4.5.2 framework is not available. Available frameworks: mono-4.0 --ArgumentException The net-4.5.2 framework is not available. Available frameworks: mono-4.0 at NUnit.Engine.Services.TestAgency.GetAgent (NUnit.Engine.TestPackage package) [0x0008e] in <83a050af71a545d186bc8c62a15c3005>:0 at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunnerIfNeeded () [0x0003d] in <83a050af71a545d186bc8c62a15c3005>:0 at NUnit.Engine.Runners.ProcessRunner.RunTests (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x0001f] in <83a050af71a545d186bc8c62a15c3005>:0

Azure DevOps pipeline failing after updating NUnit.ConsoleRunner nuget package to to 3.15 version. Command use to run the nunit test:

exec /Library/Frameworks/Mono.framework/Versions/Current/bin/mono --debug /Users/name/Documents/MyProject/packages/NUnit.ConsoleRunner.3.15.0/tools/nunit3-console.exe /Users/name/Documents/MyProject/TestProject.NUnitTest/bin/Release/TestProject.NUnitTest.dll

Provided more details here Latest Nunit consoleRunner failing

@CharliePoole CharliePoole added this to the 3.15.1 milestone Feb 18, 2022
Gankov added a commit to QualitySolution/QSProjects that referenced this issue Feb 24, 2022
@sateeshkumardamera
Copy link

Yes, same issue here with 3.15

@CharliePoole CharliePoole removed this from the 3.15.1 milestone Jun 29, 2022
@CharliePoole
Copy link
Collaborator

Removed from milestone so we can get the critical bug fixed.

@CharliePoole CharliePoole reopened this Jun 29, 2022
@CharliePoole CharliePoole added this to the 3.15.2 milestone Jun 29, 2022
@CharliePoole CharliePoole modified the milestones: 3.15.3, 3.16 Oct 19, 2022
@CharliePoole CharliePoole self-assigned this Oct 31, 2022
@CharliePoole CharliePoole added the PortToVersion4 Version 3 change needs to be ported to the version 4 code in main label Oct 31, 2022
@CharliePoole
Copy link
Collaborator

This issue has been resolved in version 3.16.0

The release is available on:
GitHub.
NuGet packages are also available NuGet.org and
Chocolatey Packages may be found at Chocolatey.org

@CharliePoole CharliePoole removed the PortToVersion4 Version 3 change needs to be ported to the version 4 code in main label Jan 7, 2023
generalmimon added a commit to kaitai-io/kaitai_struct_tests that referenced this issue Jul 14, 2024
Should fix the following error that occurred in the
`csharp/netcore{2.2.103,3.0.100}-linux-x86_64` jobs when using
`NUnit.ConsoleRunner 3.17.0`
(https://github.com/kaitai-io/ci_artifacts/blob/d5a853489f3f1a75c72e6b8a34e505388938133b/test_out/csharp/test_run.stdout#L15-L23):

```
1) Error :
System.ArgumentException : The net-4.8 framework is not available.

Available frameworks: mono-4.0
--ArgumentException
The net-4.8 framework is not available.

Available frameworks: mono-4.0
  at NUnit.Engine.Services.TestAgency.GetAgent (NUnit.Engine.TestPackage package) [0x0008e] in <98a5d354480145bf8bc83cc74d63f414>:0
  at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunnerIfNeeded () [0x0003d] in <98a5d354480145bf8bc83cc74d63f414>:0
  at NUnit.Engine.Runners.ProcessRunner.RunTests (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x0001f] in <98a5d354480145bf8bc83cc74d63f414>:0
```

See nunit/nunit-console#1130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants