Repository navigation
Fix Linux build-analysis workflow contract tests - #12431
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🧪 Test quality review — PR #12431
Compared merge base 5b3df7d89d6e7101493bb56c3a26f80f43384c23 with head 322ff31cdbf95573f3aa7825a3ca6a41d7906f35. Evidence applies to this head, not every intermediate commit.
Test-value evidence
| Contract | Scenario | Expected outcome | Test / assertion | Counterfactual | Status |
|---|---|---|---|---|---|
Fixture path substitution is single-pass (/tmp/gh-aw, /tmp/binlogs) |
Fixture root itself contains tmp/gh-aw or tmp/binlogs |
Export succeeds and GH_AW_BINLOG_LIST equals ["/data/binlogs/1_Linux.binlog"] |
test_build_context_preserves_fixture_paths_containing_workflow_paths, assertEqual(0, returncode) plus list equality |
Chained str.replace re-substitutes inside the already-replaced path and corrupts it, so the new test should fail |
Static prediction (not executed) |
Prompt cat command extraction tolerates list indentation |
Indented fenced cat line |
Regex still captures the command | Updated regex in test_build_context_is_readable_without_environment_probes |
Old regex returns no match for an indented line | Static prediction (not executed) |
| README note | Documentation only | n/a | n/a | n/a | Not applicable |
No execution records were available; this workflow does not run tests.
🧵 Parallel safety
NOT_APPLICABLE: no changed C# tests or parallelization configuration in scope.
Per-test assessment
No C#/MSTest test methods changed (the only test change is a Python unittest under .github/scripts), so there is nothing to grade. Result: Not applicable. No inline findings.
<sub>This advisory review is heuristic and non-blocking.
Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.</sub>
🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto · ~26 AIC · ⌖ ~1 AIC · ⊞ 8.1K
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the test-harness fixes addressing fixture-path preservation and Markdown indentation handling.
No open issues 🎉
What changed in this PR
Repairs the build-analysis workflow test harness failures observed during #12427, without changing shipping products, workflow definitions, or permissions.
Changes:
- Replaces chained path substitutions with one pass to preserve temporary fixture paths.
- Allows Markdown indentation before the manifest-read command.
- Adds regression coverage for both workflow variants with fixture paths containing
/tmp/gh-awor/tmp/binlogs, and documents the behavior.
Test-value evidence: For commit 322ff31cdbf95573f3aa7825a3ca6a41d7906f35, the PR reports 12 intended failing Linux subcases before repair and all 40 test methods passing afterward. Windows validation also reports the indentation failure and subsequent pass. These results were not independently executed during this review.
| File | Description |
|---|---|
.github/workflows/README.md |
Documents path preservation and indentation handling in local contract checks. |
.github/scripts/test_agentic_workflow_warning_contracts.py |
Fixes path substitution and command extraction; adds workflow/path regression cases. |
Review effort: Balanced
Pull request
Summary
Repair the test-harness failures in Check action pins run 43222179880. The pin audit itself passed; chained fixture substitutions corrupted Linux temporary paths and made valid binlog inventories appear missing. The next assertion also rejected the shared prompt's Markdown indentation.
/tmp/gh-awor/tmp/binlogs.Relates to #12427.
Design and decision record
This is a test-harness regression repair, not a feature or shipping-product change. The maintained rationale is in Authoring-warning runtime contracts.
Reversing the chained substitutions is insufficient because fixture paths can contain either prefix. A single substitution pass handles both without changing the authored scripts, runtime validation, import isolation, workflow definitions, generated locks, or permissions. The regression passes its parent directory explicitly rather than mutating process-global temporary-directory settings.
Demonstration
The retained Linux comparison executes five test methods against the original helper and reports 12 failing subcases, including all eight failures from the linked CI job. The corrected complete suite executes 40 methods with no failures or skips. Windows separately reproduces the indentation assertion failure and passes after repair.
Media is not applicable: this changes an internal CI test harness, not product output or layout. These are local component checks, not a live agent/model or safe-output publication run.
Validation and regression proof
Validated content is commit
322ff31cdbf95573f3aa7825a3ca6a41d7906f35, based on5b3df7d89d6e7101493bb56c3a26f80f43384c23. Before committing, its complete two-file patch was verified unchanged against the tested patch, SHA-2563FE36756BED48E6CEFE8EA594C856226EC6F011EA86E2C2033BE190A07FE5199.Linux checks ran in a disposable local
python:3.12-slimcontainer with read-only source mounts, Python 3.12.15 and hash-pinned PyYAML 6.0.3. Windows used Python 3.12.10 and Git Bash. Existing sequential unittest scheduling and per-export temporary-directory cleanup were preserved; the container was removed.python /comparison/.github/scripts/test_agentic_workflow_warning_contracts.py --workflow-root /workspace/.github/workflows BuildAnalysisInputTests -vpython .github/scripts/test_agentic_workflow_warning_contracts.py -vpython .github\scripts\test_agentic_workflow_warning_contracts.py BuildAnalysisInputTests -vpython .github/scripts/test_build_failure_analysis_checkout.pypython .github/scripts/check_action_pins.pyThe checkout tests and pin audit also passed on Windows. Raw paired logs and source snapshots are retained locally and are not uploaded. No .NET build/pack was needed for this Python-only executable change. Hosted model/MCP access and safe-output publication were not exercised; local results are not hosted CI results.
Test-value evidence
BuildAnalysisInputTests.test_build_context_preserves_fixture_paths_containing_workflow_pathsMissing or invalid required build-analysis inputs./data/binlogs/1_Linux.binloginventory.BuildAnalysisInputTests.test_build_context_is_readable_without_environment_probesThe new regression source was identical in the red and green runs. The comparison snapshot retains the new fixture parameter and regression while restoring the original chained substitutions and command regex; its SHA-256 is
170ED34044EF5B96AD70E41DAEC153AD5D89336766A23D2D051AB6173AA76C98. Negative-input rejection and isolated-import checks remain present and pass with the fix. No failed bootstrap, missing dependency, skip, or zero-test run is counted as regression proof.