Skip to content

Conversation

@martincostello
Copy link
Owner

Fail the benchmarks if any errors are encountered during execution.

Fail the benchmarks if any errors are encountered during execution.
Copilot AI review requested due to automatic review settings July 26, 2025 11:33
@martincostello martincostello added bug Something isn't working .NET Pull requests that update .NET code labels Jul 26, 2025
@martincostello martincostello enabled auto-merge (rebase) July 26, 2025 11:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds error handling to fail the benchmarks if any errors are encountered during execution. The changes ensure that benchmark failures are properly propagated as non-zero exit codes.

  • Modified the C# benchmark program to return exit code 1 if any benchmark reports indicate failure
  • Updated the PowerShell script to check the exit code and fail the script execution if benchmarks failed

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
perf/TodoApp.Benchmarks/Program.cs Captures benchmark summary and returns non-zero exit code when any reports indicate failure
benchmark.ps1 Adds exit code validation to propagate benchmark failures to the calling process
Comments suppressed due to low confidence (1)

perf/TodoApp.Benchmarks/Program.cs:26

  • [nitpick] The lambda parameter 'p' is ambiguous. Consider using a more descriptive name like 'report' to improve code readability.
    return summary.Reports.Any((p) => !p.Success) ? 1 : 0;

@martincostello martincostello disabled auto-merge July 26, 2025 11:37
Return 0 for `--test` branch.
@martincostello martincostello enabled auto-merge (squash) July 26, 2025 11:38
@martincostello martincostello merged commit 035a555 into main Jul 26, 2025
9 checks passed
@martincostello martincostello deleted the fix-benchmarks branch July 26, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants