Fix test failures after action pin updates#25745
Conversation
… in logs tests Agent-Logs-Url: https://github.com/github/gh-aw/sessions/edcf2728-6284-4370-b05f-957d5021be23 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates test fixtures and expectations to align with recent GitHub Action pin changes, and hardens TestPreActivationJob string matching to avoid a slice-bounds panic caused by accidentally matching container image references.
Changes:
- Updated test expectations for
actions/github-scriptandactions/upload-artifactpinned SHAs (including v7→v7.0.1 resolution). - Regenerated Wasm compile golden files to reflect updated pins (and now-digest-pinned container image refs in the generated workflow output).
- Fixed
TestPreActivationJobto locate YAML job keys more reliably by matching indented job headers (avoiding false matches like.../agent:0.25.18), and added missing “not found” guards in one test case.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/threat_detection_test.go | Updates expected upload-artifact pin SHA in detection log step test. |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden | Regenerated golden output with updated action pins and container digests. |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden | Regenerated golden output with updated action pins and container digests. |
| pkg/workflow/stop_time_check_job_test.go | Prevents false agent: matches by searching for indented job keys; adds missing index-not-found guard in one slice operation. |
| pkg/workflow/safe_output_helpers_test.go | Updates expected github-script pin SHA occurrences. |
| pkg/workflow/redact_secrets_test.go | Updates expected github-script pin SHA in redaction step assertion. |
| pkg/workflow/pr_ready_for_review_checkout_test.go | Updates expected github-script pin SHA in PR checkout assertions. |
| pkg/workflow/pr_checkout_test.go | Updates expected github-script pin SHA in PR checkout assertions. |
| pkg/workflow/mcp_logs_upload_test.go | Updates expected upload-artifact pin SHA in MCP logs upload tests. |
| pkg/workflow/compute_text_lazy_test.go | Updates expected github-script pin SHA in compiled workflow assertion. |
| pkg/workflow/compile_outputs_pr_test.go | Updates expected github-script pin SHA in safe_outputs job assertion. |
| pkg/workflow/compile_outputs_label_test.go | Updates expected github-script pin SHA in safe_outputs job assertion. |
| pkg/workflow/compile_outputs_issue_test.go | Updates expected github-script pin SHA in safe_outputs job assertion. |
| pkg/workflow/compile_outputs_comment_test.go | Updates expected github-script pin SHA in safe_outputs job assertion. |
| pkg/workflow/action_pins_test.go | Updates expected v7 SHA for upload-artifact (v7 resolves to v7.0.1 pin). |
| pkg/cli/logs_json_stderr_order_test.go | Skips JSON/stderr ordering tests when GitHub API returns HTTP 403 (no API access). |
| pkg/cli/logs_ci_scenario_test.go | Skips “no runs” JSON test when GitHub API returns HTTP 403 (no API access). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 17/17 changed files
- Comments generated: 0
🧪 Test Quality Sentinel ReportTest Quality Score: 92/100✅ Excellent test quality
Test Classification Details📋 All 16 modified tests (click to expand)
Flagged Tests — Requires ReviewNo tests require review. The one item worth noting (not a failure condition): 📎 Repeated SHA assertion pattern —
|
Commit 66fb0c5 updated action pins (
actions/github-scriptv9→v9.0.0,actions/upload-artifactv7→v7.0.1) but left tests with stale SHA expectations, plus exposed a latent bug inTestPreActivationJob.TestPreActivationJobpanic — slice bounds out of rangestrings.Index(lockContentStr, "agent:")matched the container image refgh-aw-firewall/agent:0.25.18in the YAML header before the actual job key, causingactivationIdx > agentIdx.Stale SHA expectations across 11 test files
actions/github-script:3a2844b7e...→d746ffe35...actions/upload-artifact:bbbca2dda...→043fb46d1...TestGetActionPinWithData_V7ExactMatchupdated for v7.0.1 pinWasm golden files regenerated
basic-copilot.goldenandwith-imports.goldenupdated viamake update-wasm-golden.TestLogsJSON*skip conditionsAdded
HTTP 403to skip conditions — these tests hit the real GitHub API and fail in environments without API access.