Skip to content

Conversation

@akoeplinger
Copy link
Member

We were inadvertently setting exit code = 0 even if a test failed.

This is because the way the errorlevel command works is that it checks whether the last command exit code was greater than or equal to the argument.

So checking errorlevel 0 in the if reports true even when we have exit code 1 and then we negate that and don't enter the if block.

We don't actually need this if check at all since we just want to print the value so we can just capture the %errorlevel% variable.

We were inadvertently setting exit code = 0 even if a test failed.

This is because the way the `errorlevel` command works is that it checks whether the last command exit code was **greater than or equal** to the argument.

So checking `errorlevel 0` in the if reports true even when we have exit code 1 and then we negate that and don't enter the if block.

We don't actually need this if check at all since we just want to print the value.
@akoeplinger akoeplinger requested a review from wtgodbe as a code owner December 19, 2025 11:40
Copilot AI review requested due to automatic review settings December 19, 2025 11:40
@akoeplinger akoeplinger requested a review from a team as a code owner December 19, 2025 11:40
@github-actions github-actions bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Dec 19, 2025
@akoeplinger akoeplinger added area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework and removed needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically labels Dec 19, 2025
Copy link
Contributor

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 fixes a critical bug in the Helix test runner script where test failures were incorrectly reported as successes. The issue was caused by misusing the errorlevel command in batch files, which performs a "greater than or equal" comparison rather than an equality check.

Key changes:

  • Removed the faulty if not errorlevel 0 conditional that always evaluated to false
  • Simplified exit code capture to directly use the %errorlevel% variable
  • Eliminated unnecessary initialization of exit_code=0

@akoeplinger akoeplinger merged commit f7116eb into main Dec 19, 2025
32 checks passed
@akoeplinger akoeplinger deleted the fix-exit-code branch December 19, 2025 14:00
@dotnet-policy-service dotnet-policy-service bot added this to the 11.0-preview1 milestone Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants