Gate test steps on setup success in CI pipeline#4141
Gate test steps on setup success in CI pipeline#4141paulmedynski wants to merge 3 commits intomainfrom
Conversation
…p has succeeded to gate test runs.
There was a problem hiding this comment.
Pull request overview
This PR updates the CI test job to run test-execution steps only when all prior setup steps completed successfully, reducing wasted runtime and noisy failures after setup errors.
Changes:
- Adds a “setup succeeded” gate in
ci-run-tests-job.ymland moves the x86 dotnet install before that gate. - Updates all test execution step conditions in
run-all-tests-step.ymlto requiresetupSucceeded == truewhile still usingsucceededOrFailed()to keep sibling test steps independent.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| eng/pipelines/common/templates/steps/run-all-tests-step.yml | Gates all test-run tasks on setupSucceeded to skip tests when setup fails. |
| eng/pipelines/common/templates/jobs/ci-run-tests-job.yml | Adds a gate variable setter after setup and reorders the x86 dotnet installation before tests. |
… setupSucceeded - Use pwsh instead of script for the gate step to avoid cmd.exe quote handling issues on Windows agents. - Gate publish-test-results and publish-pipeline-artifact steps on setupSucceeded to prevent secondary errors when TestResults/ doesn't exist because tests were skipped.
Ensure TestResults/ exists before the gate step so publish-test-results steps can run unconditionally (succeededOrFailed) without failing when tests are skipped due to a setup failure.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #4141 +/- ##
==========================================
- Coverage 73.22% 66.49% -6.73%
==========================================
Files 280 274 -6
Lines 43000 65785 +22785
==========================================
+ Hits 31486 43744 +12258
- Misses 11514 22041 +10527
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Gate all test-run steps in the CI pipeline so they only execute when all preceding setup steps succeed, while remaining independent of each other (a failing test step does not skip sibling test steps).
Changes
eng/pipelines/common/templates/jobs/ci-run-tests-job.ymlGate: Mark Setup Succeeded) that setssetupSucceeded=trueafter all setup completes (artifact download, SDK install, project build, SQL config, x86 SDK install)eng/pipelines/common/templates/steps/run-all-tests-step.ymlsucceededOrFailed()toand(eq(variables['setupSucceeded'], 'true'), succeededOrFailed())Behavior
Checklist