Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/workflow/mcp_setup_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ func TestMCPGatewayVersionFromFrontmatter(t *testing.T) {
// Test 1: Verify docker image collection uses the correct version
dockerImages := collectDockerImages(workflowData.Tools, workflowData, ActionModeRelease)
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
}
Comment on lines 205 to +210
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

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

Copilot uses AI. Check for mistakes.

found := false
for _, img := range dockerImages {
Expand Down
Loading