From a7559e3b35f3c8c7a71508be2bff19167945600d Mon Sep 17 00:00:00 2001 From: Damian Hickey <57436+damianh@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:30:01 +0200 Subject: [PATCH] Add a test report to the build --- .github/workflows/access-token-management-ci.yml | 15 +++++++++++++-- access-token-management/build/Program.cs | 10 ++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/access-token-management-ci.yml b/.github/workflows/access-token-management-ci.yml index d8a6f654..f75331b8 100644 --- a/.github/workflows/access-token-management-ci.yml +++ b/.github/workflows/access-token-management-ci.yml @@ -39,6 +39,17 @@ jobs: dotnet-version: | 8.0.x - - name: Build and test + - name: Build and Test shell: pwsh - run: ./build.ps1 \ No newline at end of file + run: ./build.ps1 + + - name: Test Report + id: test-report + uses: dorny/test-reporter@v1 + if: success() || failure() # run this step even if previous step failed + with: + name: Test results + path: src/helix/artifacts/test-results/*.trx + reporter: dotnet-trx + fail-on-error: true + fail-on-empty: true \ No newline at end of file diff --git a/access-token-management/build/Program.cs b/access-token-management/build/Program.cs index 943d6877..2fbbb1df 100644 --- a/access-token-management/build/Program.cs +++ b/access-token-management/build/Program.cs @@ -44,6 +44,12 @@ internal static async Task Main(string[] args) Target(Targets.Test, DependsOn(Targets.Build), () => { Run("dotnet", "test -c Release --no-build --nologo"); + await Run( + "dotnet", + $"test test/Tests -c Release --nologo" + + $"--blame-hang " + + $"--blame-hang-timeout=120sec " + + $"--logger \"console;verbosity=normal\" --logger \"trx;LogFileName={packOutput}/test-results/Test.trx\" "); }); Target(Targets.CleanPackOutput, () => @@ -56,8 +62,8 @@ internal static async Task Main(string[] args) Target(Targets.Pack, DependsOn(Targets.Build, Targets.CleanPackOutput), () => { - Run("dotnet", $"pack ./src/Duende.AccessTokenManagement/Duende.AccessTokenManagement.csproj -c Release -o {Directory.CreateDirectory(packOutput).FullName} --no-build --nologo"); - Run("dotnet", $"pack ./src/Duende.AccessTokenManagement.OpenIdConnect/Duende.AccessTokenManagement.OpenIdConnect.csproj -c Release -o {Directory.CreateDirectory(packOutput).FullName} --no-build --nologo"); + Run("dotnet", $"pack src/Duende.AccessTokenManagement/Duende.AccessTokenManagement.csproj -c Release -o {Directory.CreateDirectory(packOutput).FullName} --no-build --nologo"); + Run("dotnet", $"pack src/Duende.AccessTokenManagement.OpenIdConnect/Duende.AccessTokenManagement.OpenIdConnect.csproj -c Release -o {Directory.CreateDirectory(packOutput).FullName} --no-build --nologo"); }); Target(Targets.SignPackage, DependsOn(Targets.Pack, Targets.RestoreTools), () =>