From bafc7c2ecbb77aa93aa679998abde1e5067fed99 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 5 Oct 2023 23:13:39 +0700 Subject: [PATCH 1/5] Attempt to fix AzDo Pipelines CI/CD --- Akka.Persistence.Redis.sln | 11 ++++++ build-system/pr-validation.yaml | 2 +- build.fsx | 34 +++++++++++++++++-- build.sh | 2 +- ...kka.Persistence.Redis.Cluster.Tests.csproj | 10 ------ .../Akka.Persistence.Redis.Tests.csproj | 12 +------ 6 files changed, 46 insertions(+), 25 deletions(-) diff --git a/Akka.Persistence.Redis.sln b/Akka.Persistence.Redis.sln index 401b5b8..ed6fd3d 100644 --- a/Akka.Persistence.Redis.sln +++ b/Akka.Persistence.Redis.sln @@ -32,6 +32,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Persistence.Redis.Benchmark.DockerTests", "src\benchmarks\Akka.Persistence.Redis.Benchmark.DockerTests\Akka.Persistence.Redis.Benchmark.DockerTests.csproj", "{BFBB3933-E8FC-4574-8D60-E6FA6BEABAE9}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Persistence.Redis.Hosting", "src\Akka.Persistence.Redis.Hosting\Akka.Persistence.Redis.Hosting.csproj", "{80BD65FD-3AB6-4AF1-B0CD-573C9D50DB1E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build-system", "build-system", "{D118A7A7-A89D-450D-8218-E2AE580DEF5D}" + ProjectSection(SolutionItems) = preProject + build-system\azure-pipeline.template.yaml = build-system\azure-pipeline.template.yaml + build-system\pr-validation.yaml = build-system\pr-validation.yaml + build-system\README.md = build-system\README.md + build-system\windows-release.yaml = build-system\windows-release.yaml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -70,6 +80,7 @@ Global {6EEB8234-FAB9-4645-86EF-297240B3798A} = {1F453772-CA5E-4F41-A50E-75F3F59F72D6} {90084FC1-C04B-46BF-AA37-2ACD71E1AD4F} = {1F453772-CA5E-4F41-A50E-75F3F59F72D6} {BFBB3933-E8FC-4574-8D60-E6FA6BEABAE9} = {DA31E2A8-AE1A-474D-843C-1B6848B921E2} + {D118A7A7-A89D-450D-8218-E2AE580DEF5D} = {EB67BFB9-7589-469F-B0E0-6DDFC0032E67} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6ADAF1F3-8019-4D3E-A8B0-2BF7CF7B439B} diff --git a/build-system/pr-validation.yaml b/build-system/pr-validation.yaml index f77ecc6..849b1f4 100644 --- a/build-system/pr-validation.yaml +++ b/build-system/pr-validation.yaml @@ -29,4 +29,4 @@ jobs: displayName: 'Linux PR Validation' vmImage: 'ubuntu-latest' scriptFileName: ./build.sh - scriptArgs: RunTests + scriptArgs: RunTestsNet diff --git a/build.fsx b/build.fsx index cb473cd..38526da 100644 --- a/build.fsx +++ b/build.fsx @@ -45,6 +45,10 @@ let outputTests = __SOURCE_DIRECTORY__ @@ "TestResults" let outputPerfTests = __SOURCE_DIRECTORY__ @@ "PerfResults" let outputNuGet = output @@ "nuget" +// Configuration values for tests +let testNetFrameworkVersion = "net471" +let testNetVersion = "net7.0" + Target "Clean" (fun _ -> ActivateFinalTarget "KillCreatedProcesses" @@ -53,6 +57,9 @@ Target "Clean" (fun _ -> CleanDir outputPerfTests CleanDir outputNuGet CleanDir "docs/_site" + + CleanDirs !! "./**/bin" + CleanDirs !! "./**/obj" ) Target "AssemblyInfo" (fun _ -> @@ -99,8 +106,31 @@ Target "RunTests" (fun _ -> let runSingleProject project = let arguments = match (hasTeamCity) with - | true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --results-directory %s -- -parallel none -teamcity" (outputTests)) - | false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --results-directory %s -- -parallel none" (outputTests)) + | true -> (sprintf "test -c Release --blame-crash --blame-hang-timeout 2m --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none -teamcity" testNetFrameworkVersion outputTests) + | false -> (sprintf "test -c Release --blame-crash --blame-hang-timeout 2m --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none" testNetFrameworkVersion outputTests) + + let result = ExecProcess(fun info -> + info.FileName <- "dotnet" + info.WorkingDirectory <- (Directory.GetParent project).FullName + info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0) + + ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result + + projects |> Seq.iter (log) + projects |> Seq.iter (runSingleProject) +) + +Target "RunTestsNet" (fun _ -> + let projects = + match (isWindows) with + | true -> !! "./src/**/*.Tests.csproj" + | _ -> !! "./src/**/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here + + let runSingleProject project = + let arguments = + match (hasTeamCity) with + | true -> (sprintf "test -c Release --blame-crash --blame-hang-timeout 2m --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none -teamcity" testNetVersion outputTests) + | false -> (sprintf "test -c Release --blame-crash --blame-hang-timeout 2m --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none" testNetVersion outputTests) let result = ExecProcess(fun info -> info.FileName <- "dotnet" diff --git a/build.sh b/build.sh index fb3b8d3..d66e4b5 100644 --- a/build.sh +++ b/build.sh @@ -8,7 +8,7 @@ SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) TOOLS_DIR=$SCRIPT_DIR/tools SIGNCLIENT_DIR=$TOOLS_DIR/signclient NUGET_EXE=$TOOLS_DIR/nuget.exe -NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe +NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe FAKE_VERSION=4.61.2 FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe DOCFX_VERSION=2.49.0 diff --git a/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj b/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj index 21c4b00..c789a74 100644 --- a/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj +++ b/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj @@ -5,16 +5,6 @@ false - - $(NetFrameworkTestVersion);$(NetTestVersion) - - - - - $(NetTestVersion) - - - diff --git a/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj b/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj index 42fac94..94105f2 100644 --- a/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj +++ b/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj @@ -1,20 +1,10 @@  Akka.Persistence.Redis.Tests - $(NetFrameworkTestVersion);$(NetTestVersion) + $(NetFrameworkTestVersion);$(NetTestVersion) false - - $(NetFrameworkTestVersion);$(NetTestVersion) - - - - - $(NetTestVersion) - - - From 28313125744218227c2915a3847f0d98095dec03 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 5 Oct 2023 23:16:53 +0700 Subject: [PATCH 2/5] Fix build script --- build.fsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.fsx b/build.fsx index 38526da..c33837e 100644 --- a/build.fsx +++ b/build.fsx @@ -331,6 +331,7 @@ Target "Nuget" DoNothing // tests dependencies "Build" ==> "RunTests" +"Build" ==> "RunTestsNet" // nuget dependencies "Clean" ==> "Build" ==> "CreateNuget" @@ -342,6 +343,7 @@ Target "Nuget" DoNothing // all "BuildRelease" ==> "All" "RunTests" ==> "All" +"RunTestsNet" ==> "All" "NBench" ==> "All" "Nuget" ==> "All" From f0c6085aa1cccce888a499d314ce945e772af733 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 5 Oct 2023 23:22:14 +0700 Subject: [PATCH 3/5] Cleanup script --- Akka.Persistence.Redis.sln | 2 -- .../Akka.Persistence.Redis.Tests.csproj | 2 -- src/Directory.Packages.props | 2 -- 3 files changed, 6 deletions(-) diff --git a/Akka.Persistence.Redis.sln b/Akka.Persistence.Redis.sln index ed6fd3d..c244b8b 100644 --- a/Akka.Persistence.Redis.sln +++ b/Akka.Persistence.Redis.sln @@ -32,8 +32,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Persistence.Redis.Benchmark.DockerTests", "src\benchmarks\Akka.Persistence.Redis.Benchmark.DockerTests\Akka.Persistence.Redis.Benchmark.DockerTests.csproj", "{BFBB3933-E8FC-4574-8D60-E6FA6BEABAE9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Persistence.Redis.Hosting", "src\Akka.Persistence.Redis.Hosting\Akka.Persistence.Redis.Hosting.csproj", "{80BD65FD-3AB6-4AF1-B0CD-573C9D50DB1E}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build-system", "build-system", "{D118A7A7-A89D-450D-8218-E2AE580DEF5D}" ProjectSection(SolutionItems) = preProject build-system\azure-pipeline.template.yaml = build-system\azure-pipeline.template.yaml diff --git a/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj b/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj index 94105f2..fa787c6 100644 --- a/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj +++ b/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj @@ -11,8 +11,6 @@ - - diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 8fdebf3..82e8334 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -20,8 +20,6 @@ - - From 09e4276be7849ad0aea89c168e528fc46c160227 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 5 Oct 2023 23:36:57 +0700 Subject: [PATCH 4/5] Fix project dependencies --- .../Akka.Persistence.Redis.Cluster.Tests.csproj | 2 -- .../Akka.Persistence.Redis.Benchmark.DockerTests.csproj | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj b/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj index c789a74..8bb2507 100644 --- a/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj +++ b/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj @@ -11,8 +11,6 @@ - - diff --git a/src/benchmarks/Akka.Persistence.Redis.Benchmark.DockerTests/Akka.Persistence.Redis.Benchmark.DockerTests.csproj b/src/benchmarks/Akka.Persistence.Redis.Benchmark.DockerTests/Akka.Persistence.Redis.Benchmark.DockerTests.csproj index 83415c5..c09c06c 100644 --- a/src/benchmarks/Akka.Persistence.Redis.Benchmark.DockerTests/Akka.Persistence.Redis.Benchmark.DockerTests.csproj +++ b/src/benchmarks/Akka.Persistence.Redis.Benchmark.DockerTests/Akka.Persistence.Redis.Benchmark.DockerTests.csproj @@ -12,8 +12,6 @@ - - From 94215f5466757c4bcd5ed264023a38064d6a2c5c Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 5 Oct 2023 23:43:32 +0700 Subject: [PATCH 5/5] Revert conditional framework in csproj --- .../Akka.Persistence.Redis.Cluster.Tests.csproj | 11 ++++++++++- .../Akka.Persistence.Redis.Tests.csproj | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj b/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj index 8bb2507..5daf494 100644 --- a/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj +++ b/src/Akka.Persistence.Redis.Cluster.Tests/Akka.Persistence.Redis.Cluster.Tests.csproj @@ -1,10 +1,19 @@  Akka.Persistence.Redis.Cluster.Tests - $(NetFrameworkTestVersion);$(NetTestVersion) false + + $(NetFrameworkTestVersion);$(NetTestVersion) + + + + + $(NetTestVersion) + + + diff --git a/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj b/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj index fa787c6..80fd921 100644 --- a/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj +++ b/src/Akka.Persistence.Redis.Tests/Akka.Persistence.Redis.Tests.csproj @@ -1,10 +1,19 @@  Akka.Persistence.Redis.Tests - $(NetFrameworkTestVersion);$(NetTestVersion) false + + $(NetFrameworkTestVersion);$(NetTestVersion) + + + + + $(NetTestVersion) + + +