Skip to content

Fix bicep test exit code on compilation errors - #20305

Open
πάθει κόσμος (pathei-kosmos) wants to merge 1 commit into
Azure:mainfrom
pathei-kosmos:fix-test-command-compilation-errors
Open

Fix bicep test exit code on compilation errors#20305
πάθει κόσμος (pathei-kosmos) wants to merge 1 commit into
Azure:mainfrom
pathei-kosmos:fix-test-command-compilation-errors

Conversation

@pathei-kosmos

@pathei-kosmos πάθει κόσμος (pathei-kosmos) commented Sep 12, 2026

Copy link
Copy Markdown

Description

bicep test used only test evaluation results to determine its exit code. Compilation errors could therefore be reported while the command still returned 0 and printed an overall success summary.

This change includes compilation errors in the exit status and suppresses the overall success summary when they are present. Per-test results remain available, so existing skipped and failed evaluation output is unchanged.

Fixes #20304.

Example Usage

For a test declaration that references a missing file, bicep test now reports BCP091 and returns exit code 1 without printing "All 0 evaluations passed".

Validation

  • Added a regression test with one valid test and one missing target
  • Bicep.Cli.IntegrationTests in Release: 1134 passed

Checklist

Microsoft Reviewers: Open in CodeFlow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bicep test returns exit code 0 when compilation fails

1 participant