Conversation
…ntainer image The test was comparing bare container:tag against the output of collectDockerImages, which applies embedded container pins from action_pins.json. For v0.2.30 (the default), the embedded pin returns container:tag@sha256:... causing the equality assertion to fail. Fix: resolve the expected image through lookupContainerPin before asserting, so the test accounts for digest pinning while still validating the correct version is used. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/5ab849a0-0bfd-4f29-b06b-02949f96e6a4 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates an integration test to account for container digest pinning so CI no longer fails when collectDockerImages returns digest-pinned image references.
Changes:
- Resolves the expected MCP gateway container image through
lookupContainerPinbefore asserting equality againstcollectDockerImagesoutput.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/mcp_setup_generator_test.go |
Adjusts expected MCP gateway image assertions to handle embedded digest pinning. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
| expectedImage := constants.DefaultMCPGatewayContainer + ":" + tt.expectedVersion | ||
| // collectDockerImages applies embedded container pins when available, so resolve | ||
| // the pinned reference for the expected image if one exists. | ||
| if pin, ok := lookupContainerPin(expectedImage, nil); ok && pin.PinnedImage != "" { | ||
| expectedImage = pin.PinnedImage | ||
| } |
There was a problem hiding this comment.
expectedImage is mutated to the digest-pinned reference and then reused in Test 2 (assert.Contains(setupOutput, expectedImage, ...)). Since the rendered YAML always contains the pinned image in the download step, this assertion can pass even if buildMCPGatewayContainerCommand (the actual gateway docker run command) uses the wrong tag/version. To keep the original intent, keep two expectations: (1) expectedTaggedImage := <container>:<version> for validating the gateway command, and (2) expectedPinnedImage for validating collectDockerImages output (download step).
🧪 Test Quality Sentinel ReportTest Quality Score: 95/100✅ Excellent test quality
Test Classification Details
AnalysisThis PR modifies What changed: The test previously compared Design invariant enforced: The test verifies that the MCP gateway container version specified in frontmatter (or the default) is faithfully used in both the docker predownload image list and the MCP gateway setup command output — a behavioral contract that users of the Value if deleted: High — a regression where frontmatter version is ignored (or wrongly overridden) would go undetected. Edge cases covered (table-driven, 5 rows):
The fix scores 95 rather than 100 only because the Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
References: §24852111962
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 95/100. Test quality is excellent — 0% of new/modified tests are implementation tests (threshold: 30%). The fix correctly updates TestMCPGatewayVersionFromFrontmatter to resolve pinned container image references before asserting, making the test accurate without sacrificing behavioral coverage.
Summary
Fixes the failing Integration: Workflow Infra CI job (check run 72739305683).
Root Cause
TestMCPGatewayVersionFromFrontmattersubtestsno_version_specified_-_should_use_defaultandempty_version_string_-_should_use_defaultwere failing because:expectedImage = "ghcr.io/github/gh-aw-mcpg:v0.2.30"(bare tag)collectDockerImagesapplies embedded container pins frompkg/actionpins/data/action_pins.jsonaction_pins.jsonhas a pin forv0.2.30:ghcr.io/github/gh-aw-mcpg:v0.2.30@sha256:e950e6d39f003862d33bfb8d4eb93e242d919cf6ca874b90728e5e0ea7434c6fassert.EqualfailedFix
Resolve the expected image through
lookupContainerPinbefore asserting equality, so the test accounts for digest pinning while still validating that the correct version tag is used.All 5
TestMCPGatewayVersionFromFrontmattersubtests now pass.