[CI] Avoid generic build failures for reported test failures - #5976
[CI] Avoid generic build failures for reported test failures#5976mdh1418 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts CI/test signaling so that, for ordinary xUnit failures, Azure Pipelines test-result publishing becomes the authoritative failure mechanism (instead of also reporting a generic build/script failure), while still failing the build for runner/result corruption scenarios.
Changes:
- Adds an MSBuild post-test validation target to ensure suppressed test failures still produce valid/usable xUnit result XML and to fail for missing/assembly-level error conditions.
- Updates the Azure Pipelines build template to (a) suppress “error on test failure” during the build/test step and (b) fail via
PublishTestResults@2for test failures, while still publishing partial results on build/test step failures. - Marks the Windows ARM64 cross-build leg as not running tests (
runTests: false).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| eng/Tests.targets | Adds MSBuild validation logic intended to catch missing/malformed/assembly-error test results when test-failure suppression is enabled. |
| eng/pipelines/build.yml | Adjusts CI step env/conditions and splits test publishing into “partial on failed build” vs “authoritative on succeeded build”. |
| diagnostics.yml | Disables test execution for Windows ARM64 Release cross-build configuration. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Allow individual build configurations to opt out of tests and mark the Windows ARM64 cross-build accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 50c882d5-6e28-47ad-b716-dfb030393508
Validate that suppressed xUnit failures still produce well-formed results and preserve assembly-level errors as build failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 50c882d5-6e28-47ad-b716-dfb030393508
75abe40 to
59b2636
Compare
59b2636 to
3a425ed
Compare
Suppress Arcade's generic MSBuild error for ordinary xUnit failures and make PublishTestResults the authoritative Build Analysis signal while preserving partial results after other failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 50c882d5-6e28-47ad-b716-dfb030393508
Run only Alpine3_23_x64_Release and its prerequisite build in pull requests, and force diagnostics issue dotnet#5659 to validate Build Analysis quickly. Revert this commit after validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 50c882d5-6e28-47ad-b716-dfb030393508
3a425ed to
d73536c
Compare
81e9cdf to
8fe4163
Compare
|
This doesn't quite work. With If we restore Two likely solutions
|

Summary
Make published Azure Pipelines test results the authoritative Build Analysis signal for ordinary xUnit test failures.
Motivation
Build Analysis can match individual test failures against known issues, but diagnostics currently also reports the enclosing test step as a generic Build failed with exit code 1 or Bash exited with code 1 failure. Making PublishTestResults fail on failed tests similarly adds the generic There are one or more test failures detected in result files error. Those generic failures cannot safely be matched to a known test issue because they can represent unrelated failures.
The runtime pipeline leaves individual published test results for Build Analysis to evaluate instead of requiring a second generic failure from the test runner. This change applies equivalent behavior to diagnostics' Arcade-based local test execution while preserving real publication failures.
Behavior
Ordinary failed tests now:
Missing results and genuine result-publication failures still fail PublishTestResults . Runner crashes, timeouts, malformed XML, assembly-level xUnit errors, and genuine build/script failures continue to fail independently.