diff --git a/benchmark.ps1 b/benchmark.ps1 index ba44a77b..9e6c7ef2 100755 --- a/benchmark.ps1 +++ b/benchmark.ps1 @@ -91,3 +91,8 @@ if (-Not [string]::IsNullOrEmpty(${env:GITHUB_SHA})) { } & $dotnet run --project $benchmarks --configuration "Release" -- $additionalArgs + +if ($LASTEXITCODE -ne 0) { + Write-Error "Benchmarks failed with exit code $LASTEXITCODE." + exit $LASTEXITCODE +} diff --git a/perf/TodoApp.Benchmarks/Program.cs b/perf/TodoApp.Benchmarks/Program.cs index 036a136e..ca25c89c 100644 --- a/perf/TodoApp.Benchmarks/Program.cs +++ b/perf/TodoApp.Benchmarks/Program.cs @@ -19,8 +19,11 @@ { await benchmarks.StopServer(); } + + return 0; } else { - BenchmarkRunner.Run(args: args); + var summary = BenchmarkRunner.Run(args: args); + return summary.Reports.Any((p) => !p.Success) ? 1 : 0; }