Skip to content

Fix Linux build-analysis workflow contract tests - #12431

Merged
Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/workflow-failure-fix
Nov 12, 2026
Merged

Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/workflow-failure-fix

Conversation

@Evangelink

Copy link
Copy Markdown
Member

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.

  • Substitute authored paths in one pass so inserted fixture paths are not rewritten.
  • Accept indentation before the allowed manifest command.
  • Cover both workflow variants with fixture parents containing either /tmp/gh-aw or /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 on 5b3df7d89d6e7101493bb56c3a26f80f43384c23. Before committing, its complete two-file patch was verified unchanged against the tested patch, SHA-256 3FE36756BED48E6CEFE8EA594C856226EC6F011EA86E2C2033BE190A07FE5199.

Linux checks ran in a disposable local python:3.12-slim container 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.

Environment Exact command Result
Linux, retained original helper/regex with new regression present python /comparison/.github/scripts/test_agentic_workflow_warning_contracts.py --workflow-root /workspace/.github/workflows BuildAnalysisInputTests -v Exit 1; five methods executed, 12 intended failing subcases.
Linux, corrected complete suite python .github/scripts/test_agentic_workflow_warning_contracts.py -v Exit 0; 40 methods passed, no skips.
Windows, original then corrected focused selection python .github\scripts\test_agentic_workflow_warning_contracts.py BuildAnalysisInputTests -v Original: exit 1, five methods and four failing subcases. Corrected: exit 0, five methods passed, no skips.
Linux, neighboring checkout contracts python .github/scripts/test_build_failure_analysis_checkout.py Exit 0; six tests passed.
Linux, pin audit python .github/scripts/check_action_pins.py Exit 0; 2,769 references across 60 files passed.

The 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

Contract / case Without the repair With the repair
BuildAnalysisInputTests.test_build_context_preserves_fixture_paths_containing_workflow_paths Linux: all four workflow/prefix subcases fail with Missing or invalid required build-analysis inputs. All four subcases pass; the manifest retains the exact /data/binlogs/1_Linux.binlog inventory.
BuildAnalysisInputTests.test_build_context_is_readable_without_environment_probes Windows: both workflow subcases reach the Markdown assertion and fail because the indented command is not matched. Both pass, including the allowed-command check and reading the complete manifest.

The 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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 13:26
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Nov 12, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 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

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 12, 2026
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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-aw or /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

@Evangelink
Amaury Levé (Evangelink) merged commit 37f2e27 into main Nov 12, 2026
23 of 25 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/workflow-failure-fix branch November 12, 2026 14:02
@github-actions github-actions Bot removed the state/needs-review Awaiting review from the team. label Nov 12, 2026
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.

2 participants