From 8dc335c9155744ab996ce22a26eaf414af47a505 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Mon, 24 Jun 2024 13:04:14 -0700 Subject: [PATCH 1/2] arm64tests --- eng/build.sh | 18 ++++++++++++++---- .../DependencyManagerInteractiveTests.fs | 12 ++++++++++++ .../FSharpScriptTests.fs | 4 ++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/eng/build.sh b/eng/build.sh index e0a3348bfdb..ca1290dc8e8 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -26,6 +26,7 @@ usage() echo " --testcoreclr Run unit tests on .NET Core (short: --test, -t)" echo " --testCompilerComponentTests Run FSharp.Compiler.ComponentTests on .NET Core" echo " --testBenchmarks Build and Run Benchmark suite" + echo " --testScripting Run FSharp.Private.ScriptingTests on .NET Core" echo "" echo "Advanced settings:" echo " --ci Building in CI" @@ -60,6 +61,7 @@ publish=false test_core_clr=false test_compilercomponent_tests=false test_benchmarks=false +test_scripting=false configuration="Debug" verbosity='minimal' binary_log=false @@ -136,6 +138,9 @@ while [[ $# > 0 ]]; do --testbenchmarks) test_benchmarks=true ;; + --testscripting) + test_scripting=true + ;; --ci) ci=true ;; @@ -219,7 +224,7 @@ function TestUsingNUnit() { projectname=$(basename -- "$testproject") projectname="${projectname%.*}" testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" - args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\"$filterArgs --blame --results-directory $artifacts_dir/TestResults/$configuration" + args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\"$filterArgs --blame --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" "$DOTNET_INSTALL_DIR/dotnet" $args || exit $? } @@ -325,9 +330,9 @@ BuildSolution if [[ "$test_core_clr" == true ]]; then coreclrtestframework=$tfm TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework --notestfilter - TestUsingXUnit --testproject "$repo_root/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj" --targetframework $coreclrtestframework --notestfilter + TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj" --targetframework $coreclrtestframework --notestfilter TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework - TestUsingXUnit --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework + TestUsingNUnit --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework TestUsingNUnit --testproject "$repo_root/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj" --targetframework $coreclrtestframework fi @@ -342,4 +347,9 @@ if [[ "$test_benchmarks" == true ]]; then popd fi -ExitWithExitCode 0 +if [[ "$test_scripting" == true ]]; then + coreclrtestframework=$tfm + TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework +fi + +ExitWithExitCode 0 \ No newline at end of file diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs index 19c3009b17a..18e96ddbced 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs @@ -264,6 +264,10 @@ TorchSharp.Tensor.LongTensor.From([| 0L .. 100L |]).Device [] member _.``Use Dependency Manager to restore packages with native dependencies, build and run script that depends on the results``() = + // Skip test on arm64, because there is not an arm64 netive library + if RuntimeInformation.ProcessArchitecture = Architecture.Arm64 then + () + else let packagemanagerlines = [| "r", "Microsoft.ML,version=1.4.0-preview" "r", "Microsoft.ML.AutoML,version=0.16.0-preview" @@ -360,6 +364,10 @@ printfn ""%A"" result [] member _.``Use NativeResolver to resolve native dlls.``() = + // Skip test on arm64, because there is not an arm64 netive library + if RuntimeInformation.ProcessArchitecture = Architecture.Arm64 then + () + else let packagemanagerlines = [| "r", "Microsoft.ML,version=1.4.0-preview" "r", "Microsoft.ML.AutoML,version=0.16.0-preview" @@ -442,6 +450,10 @@ printfn ""%A"" result [] member _.``Use AssemblyResolver to resolve assemblies``() = + // Skip test on arm64, because there is not an arm64 netive library + if RuntimeInformation.ProcessArchitecture = Architecture.Arm64 then + () + else let packagemanagerlines = [| "r", "Microsoft.ML,version=1.4.0-preview" "r", "Microsoft.ML.AutoML,version=0.16.0-preview" diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs index 78a535c39b9..0e8175d950d 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs @@ -247,6 +247,10 @@ System.Configuration.ConfigurationManager.AppSettings.Item "Environment" <- "LOC #if NETSTANDARD [] member _.``ML - use assembly with native dependencies``() = + // Skip test on arm64, because there is not an arm64 netive library + if RuntimeInformation.ProcessArchitecture = Architecture.Arm64 then + () + else let code = @" #r ""nuget:Microsoft.ML,version=1.4.0-preview"" #r ""nuget:Microsoft.ML.AutoML,version=0.16.0-preview"" From 97cc9d3b750d41ef4d458eab6b073fd60ed2aca3 Mon Sep 17 00:00:00 2001 From: Petr Date: Fri, 28 Jun 2024 12:47:48 +0200 Subject: [PATCH 2/2] Update build.sh --- eng/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/build.sh b/eng/build.sh index ff611b64d73..e678acefae3 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -339,7 +339,7 @@ fi if [[ "$test_scripting" == true ]]; then coreclrtestframework=$tfm - TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework + Test --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework fi -ExitWithExitCode 0 \ No newline at end of file +ExitWithExitCode 0