Skip to content

Commit 8d3895b

Browse files
committed
scripts/make.fsx: set DOTNET_ROLL_FORWARD for unit tests
This is to fix all CI failures related to .NET versions mismatch, which were giving this error: ``` dotnet test /home/runner/work/geewallet/geewallet/src/GWallet.Backend.Tests/GWallet.Backend.Tests.fsproj --configuration Debug Determining projects to restore... All projects are up-to-date for restore. GWallet.Backend -> /home/runner/work/geewallet/geewallet/src/GWallet.Backend/bin/Debug/netstandard2.0/GWallet.Backend.dll GWallet.Backend.Tests -> /home/runner/work/geewallet/geewallet/src/GWallet.Backend.Tests/bin/Debug/net6.0/GWallet.Backend.Tests.dll Test run for /home/runner/work/geewallet/geewallet/src/GWallet.Backend.Tests/bin/Debug/net6.0/GWallet.Backend.Tests.dll (.NETCoreApp,Version=v6.0) VSTest version 18.0.1 (x64) Starting test execution, please wait... A total of 1 test files matched the specified pattern. Testhost process for source(s) '/home/runner/work/geewallet/geewallet/src/GWallet.Backend.Tests/bin/Debug/net6.0/GWallet.Backend.Tests.dll' exited with error: You must install or update .NET to run this application. App: /home/runner/work/geewallet/geewallet/src/GWallet.Backend.Tests/bin/Debug/net6.0/testhost.dll Architecture: x64 Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64) .NET location: /usr/share/dotnet/ The following frameworks were found: 8.0.6 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] 8.0.22 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] 9.0.6 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] 9.0.11 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] 10.0.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] Learn more: https://aka.ms/dotnet/app-launch-failed To install missing framework, download: https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=x64&rid=linux-x64&os=ubuntu.24.04 . Please check the diagnostic logs for more information. Test Run Aborted. Error when running 'dotnet test /home/runner/work/geewallet/geewallet/src/GWallet.Backend.Tests/GWallet.Backend.Tests.fsproj --configuration Debug' Fsdk.Process+ProcessFailed: Exception of type 'Fsdk.Process+ProcessFailed' was thrown. at Fsdk.Process.ProcessResult.Unwrap(String errMsg) at Fsdk.Process.ProcessResult.UnwrapDefault() at <StartupCode$FSI_0007>.$FSI_0007.main@() in /home/runner/work/geewallet/geewallet/scripts/make.fsx:line 443 at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) Stopped due to error make: *** [Makefile:8: check] Error 1 Error: Process completed with exit code 2. ```
1 parent 61f1097 commit 8d3895b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/make.fsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ match maybeTarget with
384384
testProjectName,
385385
testProjectName + ".fsproj"
386386
) |> FileInfo
387+
388+
// somehow sometimes the binary is seen by NUnit as 6.0, while we already have a .NET8.0 (or newer) runtime
389+
Environment.SetEnvironmentVariable("DOTNET_ROLL_FORWARD", "major")
387390
#else
388391
// so that we get file names in stack traces
389392
Environment.SetEnvironmentVariable("MONO_ENV_OPTIONS", "--debug")

0 commit comments

Comments
 (0)