Skip to content

Commit

Permalink
Attempt to fix AzDo Pipelines CI/CD (#284)
Browse files Browse the repository at this point in the history
* Attempt to fix AzDo Pipelines CI/CD

* Fix build script

* Cleanup script

* Fix project dependencies

* Revert conditional framework in csproj
  • Loading branch information
Arkatufus committed Oct 5, 2023
1 parent 389d3e2 commit 1b60dc7
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 14 deletions.
9 changes: 9 additions & 0 deletions Akka.Persistence.Redis.sln
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ 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("{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
Expand Down Expand Up @@ -70,6 +78,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}
Expand Down
2 changes: 1 addition & 1 deletion build-system/pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
displayName: 'Linux PR Validation'
vmImage: 'ubuntu-latest'
scriptFileName: ./build.sh
scriptArgs: RunTests
scriptArgs: RunTestsNet
36 changes: 34 additions & 2 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -53,6 +57,9 @@ Target "Clean" (fun _ ->
CleanDir outputPerfTests
CleanDir outputNuGet
CleanDir "docs/_site"

CleanDirs !! "./**/bin"
CleanDirs !! "./**/obj"
)

Target "AssemblyInfo" (fun _ ->
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -301,6 +331,7 @@ Target "Nuget" DoNothing

// tests dependencies
"Build" ==> "RunTests"
"Build" ==> "RunTestsNet"

// nuget dependencies
"Clean" ==> "Build" ==> "CreateNuget"
Expand All @@ -312,6 +343,7 @@ Target "Nuget" DoNothing
// all
"BuildRelease" ==> "All"
"RunTests" ==> "All"
"RunTestsNet" ==> "All"
"NBench" ==> "All"
"Nuget" ==> "All"

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyTitle>Akka.Persistence.Redis.Cluster.Tests</AssemblyTitle>
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetTestVersion)</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -21,8 +20,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<!-- Needed by Redis to run -->
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
<PackageReference Include="Docker.DotNet" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyTitle>Akka.Persistence.Redis.Tests</AssemblyTitle>
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetTestVersion)</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -21,8 +20,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<!-- Needed by Redis to run -->
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
<PackageReference Include="Docker.DotNet" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" >
Expand Down
2 changes: 0 additions & 2 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
<PackageVersion Include="Akka.Streams.TestKit" Version="$(AkkaVersion)" />

<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<!-- Needed by Redis to run -->
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageVersion Include="Docker.DotNet" Version="3.125.15" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Docker.DotNet" />
<!-- Needed by Redis to run -->
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
<PackageReference Include="Akka" />
<PackageReference Include="JetBrains.dotMemoryUnit" />
<PackageReference Include="xunit" />
Expand Down

0 comments on commit 1b60dc7

Please sign in to comment.