Skip to content

Centralize MCP images used in e2e tests into a dedicated package #2786

@JAORMX

Description

@JAORMX

Summary

The e2e tests currently have MCP container images scattered across multiple Go test files, making it difficult to maintain consistent versions and configure automated updates via Renovate.

Current State

Images in use

Image Occurrences
ghcr.io/stackloklabs/yardstick/yardstick-server:0.0.2 1 constant, used in 2 files
ghcr.io/stackloklabs/gofetch/server:1.0.1 6
ghcr.io/stackloklabs/osv-mcp/server:0.0.7 4
python:3.9-slim 2 (utility pods)
curlimages/curl:latest 1 (utility pods)

Current locations

  • test/e2e/thv-operator/virtualmcp/virtualmcp_yardstick_base_test.go - has one constant (YardstickImage)
  • test/e2e/thv-operator/virtualmcp/virtualmcp_tokenexchange_test.go - inline
  • test/e2e/thv-operator/virtualmcp/virtualmcp_inline_auth_test.go - inline
  • test/e2e/thv-operator/virtualmcp/virtualmcp_discovered_mode_test.go - inline
  • test/e2e/thv-operator/virtualmcp/virtualmcp_auth_discovery_test.go - inline
  • test/e2e/thv-operator/virtualmcp/virtualmcp_aggregation_filtering_test.go - inline
  • test/e2e/thv-operator/virtualmcp/helpers.go - inline (utility images)
  • test/e2e/telemetry_metrics_validation_e2e_test.go - inline

Proposed Solution

Create a dedicated package test/e2e/images that exports all MCP test image constants:

package images

const (
    // MCP server images
    YardstickServer = "ghcr.io/stackloklabs/yardstick/yardstick-server:0.0.2"
    GofetchServer   = "ghcr.io/stackloklabs/gofetch/server:1.0.1"
    OSVMCPServer    = "ghcr.io/stackloklabs/osv-mcp/server:0.0.7"

    // Utility images for test helpers
    PythonSlim = "python:3.9-slim"
    Curl       = "curlimages/curl:latest"
)

Benefits

  1. Single source of truth - All image versions in one place
  2. Renovate integration - Can configure Renovate to automatically update image versions in the constants file
  3. Easier maintenance - Version bumps require changes to only one file
  4. Consistency - Ensures all tests use the same image versions

Tasks

  • Create test/e2e/images/images.go package with all image constants
  • Update all Go test files to import and use the centralized constants
  • Add Renovate configuration for the new images package

Out of Scope

Chainsaw YAML test files are excluded from this effort for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgoPull requests that update go codegood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions