Skip to content
Open
Show file tree
Hide file tree
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
42 changes: 42 additions & 0 deletions test/e2e/images/images.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Package images provides centralized container image references for e2e tests.
// This package serves as a single source of truth for all container images used
// in end-to-end testing, making it easier to maintain versions and enabling
// automated dependency updates through tools like Renovate.
//
// Each image is composed of an imageURL (base path) and imageTag (version).
// The complete Image constant combines the URL and tag for use in tests.
package images

const (
yardstickServerImageURL = "ghcr.io/stackloklabs/yardstick/yardstick-server"
yardstickServerImageTag = "0.0.2"
// YardstickServerImage is used in operator tests across multiple transport protocols
// (stdio, SSE, streamable-http) and tenancy modes.
// Note: This image is also referenced in 8 YAML fixture files under
// test/e2e/chainsaw/operator/. Those files are declarative Kubernetes manifests
// and cannot import Go constants directly.
YardstickServerImage = yardstickServerImageURL + ":" + yardstickServerImageTag

gofetchServerImageURL = "ghcr.io/stackloklabs/gofetch/server"
gofetchServerImageTag = "1.0.1"
// GofetchServerImage is used for testing virtual MCP server features, including
// authentication flows and backend aggregation.
GofetchServerImage = gofetchServerImageURL + ":" + gofetchServerImageTag

osvmcpServerImageURL = "ghcr.io/stackloklabs/osv-mcp/server"
osvmcpServerImageTag = "0.0.7"
// OSVMCPServerImage is used for testing discovered mode aggregation and telemetry
// metrics validation.
OSVMCPServerImage = osvmcpServerImageURL + ":" + osvmcpServerImageTag

pythonImageURL = "python"
pythonImageTag = "3.9-slim"
// PythonImage is used for deploying mock OIDC servers and instrumented backend servers
// in Kubernetes tests. These run Flask-based Python services for testing authentication flows.
PythonImage = pythonImageURL + ":" + pythonImageTag

curlImageURL = "curlimages/curl"
curlImageTag = "latest"
// CurlImage is used to query service endpoints and gather statistics during Kubernetes tests.
CurlImage = curlImageURL + ":" + curlImageTag
)
3 changes: 2 additions & 1 deletion test/e2e/telemetry_metrics_validation_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"github.com/stacklok/toolhive/pkg/transport/types"
"github.com/stacklok/toolhive/test/e2e"
"github.com/stacklok/toolhive/test/e2e/images"
)

var _ = Describe("Telemetry Metrics Validation E2E", Label("telemetry", "metrics", "validation", "e2e"), Serial, func() {
Expand Down Expand Up @@ -88,7 +89,7 @@ var _ = Describe("Telemetry Metrics Validation E2E", Label("telemetry", "metrics
"--transport", types.TransportTypeSSE.String(),
"--otel-enable-prometheus-metrics-path",
"--name", inferredName, // Still need explicit name for cleanup
"ghcr.io/stackloklabs/osv-mcp/server:0.0.7",
images.OSVMCPServerImage,
).ExpectSuccess()

// Update workloadName for cleanup
Expand Down
7 changes: 4 additions & 3 deletions test/e2e/thv-operator/virtualmcp/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

mcpv1alpha1 "github.com/stacklok/toolhive/cmd/thv-operator/api/v1alpha1"
"github.com/stacklok/toolhive/test/e2e/images"
)

// WaitForVirtualMCPServerReady waits for a VirtualMCPServer to reach Ready status
Expand Down Expand Up @@ -294,7 +295,7 @@ func DeployMockOIDCServerHTTP(ctx context.Context, c client.Client, namespace, s
Containers: []corev1.Container{
{
Name: "mock-oidc",
Image: "python:3.9-slim",
Image: images.PythonImage,
Command: []string{"sh", "-c"},
Args: []string{MockOIDCServerHTTPScript},
Ports: []corev1.ContainerPort{
Expand Down Expand Up @@ -353,7 +354,7 @@ func DeployInstrumentedBackendServer(ctx context.Context, c client.Client, names
Containers: []corev1.Container{
{
Name: "instrumented-backend",
Image: "python:3.9-slim",
Image: images.PythonImage,
Command: []string{"sh", "-c"},
Args: []string{InstrumentedBackendScript},
Ports: []corev1.ContainerPort{
Expand Down Expand Up @@ -452,7 +453,7 @@ func GetServiceStats(ctx context.Context, c client.Client, namespace, serviceNam
Containers: []corev1.Container{
{
Name: "curl",
Image: "curlimages/curl:latest",
Image: images.CurlImage,
Command: []string{"curl", "-s", fmt.Sprintf("http://%s.%s.svc.cluster.local:%d/stats", serviceName, namespace, port)},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"k8s.io/apimachinery/pkg/types"

mcpv1alpha1 "github.com/stacklok/toolhive/cmd/thv-operator/api/v1alpha1"
"github.com/stacklok/toolhive/test/e2e/images"
)

var _ = Describe("VirtualMCPServer Auth Discovery", Ordered, func() {
Expand Down Expand Up @@ -142,7 +143,7 @@ var _ = Describe("VirtualMCPServer Auth Discovery", Ordered, func() {
},
Spec: mcpv1alpha1.MCPServerSpec{
GroupRef: mcpGroupName,
Image: "ghcr.io/stackloklabs/gofetch/server:1.0.1",
Image: images.GofetchServerImage,
Transport: "streamable-http",
ProxyPort: 8080,
McpPort: 8080,
Expand All @@ -161,7 +162,7 @@ var _ = Describe("VirtualMCPServer Auth Discovery", Ordered, func() {
},
Spec: mcpv1alpha1.MCPServerSpec{
GroupRef: mcpGroupName,
Image: "ghcr.io/stackloklabs/osv-mcp/server:0.0.7",
Image: images.OSVMCPServerImage,
Transport: "streamable-http",
ProxyPort: 8080,
McpPort: 8080,
Expand All @@ -180,7 +181,7 @@ var _ = Describe("VirtualMCPServer Auth Discovery", Ordered, func() {
},
Spec: mcpv1alpha1.MCPServerSpec{
GroupRef: mcpGroupName,
Image: "ghcr.io/stackloklabs/gofetch/server:1.0.1",
Image: images.GofetchServerImage,
Transport: "streamable-http",
ProxyPort: 8080,
McpPort: 8080,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"k8s.io/apimachinery/pkg/types"

mcpv1alpha1 "github.com/stacklok/toolhive/cmd/thv-operator/api/v1alpha1"
"github.com/stacklok/toolhive/test/e2e/images"
)

var _ = Describe("VirtualMCPServer Discovered Mode", Ordered, func() {
Expand Down Expand Up @@ -67,7 +68,7 @@ var _ = Describe("VirtualMCPServer Discovered Mode", Ordered, func() {
},
Spec: mcpv1alpha1.MCPServerSpec{
GroupRef: mcpGroupName,
Image: "ghcr.io/stackloklabs/gofetch/server:1.0.1",
Image: images.GofetchServerImage,
Transport: "streamable-http",
ProxyPort: 8080,
McpPort: 8080,
Expand All @@ -83,7 +84,7 @@ var _ = Describe("VirtualMCPServer Discovered Mode", Ordered, func() {
},
Spec: mcpv1alpha1.MCPServerSpec{
GroupRef: mcpGroupName,
Image: "ghcr.io/stackloklabs/osv-mcp/server:0.0.7",
Image: images.OSVMCPServerImage,
Transport: "streamable-http",
ProxyPort: 8080,
McpPort: 8080,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"k8s.io/apimachinery/pkg/types"

mcpv1alpha1 "github.com/stacklok/toolhive/cmd/thv-operator/api/v1alpha1"
"github.com/stacklok/toolhive/test/e2e/images"
)

var _ = Describe("VirtualMCPServer Inline Auth with Anonymous Incoming", Ordered, func() {
Expand Down Expand Up @@ -65,7 +66,7 @@ var _ = Describe("VirtualMCPServer Inline Auth with Anonymous Incoming", Ordered
},
Spec: mcpv1alpha1.MCPServerSpec{
GroupRef: mcpGroupName,
Image: "ghcr.io/stackloklabs/gofetch/server:1.0.1",
Image: images.GofetchServerImage,
Transport: "streamable-http",
ProxyPort: 8080,
McpPort: 8080,
Expand Down Expand Up @@ -285,7 +286,7 @@ var _ = Describe("VirtualMCPServer Inline Auth with OIDC Incoming", Ordered, fun
},
Spec: mcpv1alpha1.MCPServerSpec{
GroupRef: mcpGroupName,
Image: "ghcr.io/stackloklabs/gofetch/server:1.0.1",
Image: images.GofetchServerImage,
Transport: "streamable-http",
ProxyPort: 8080,
McpPort: 8080,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"k8s.io/apimachinery/pkg/types"

mcpv1alpha1 "github.com/stacklok/toolhive/cmd/thv-operator/api/v1alpha1"
"github.com/stacklok/toolhive/test/e2e/images"
)

var _ = Describe("VirtualMCPServer Token Exchange Auth", Ordered, func() {
Expand Down Expand Up @@ -110,7 +111,7 @@ var _ = Describe("VirtualMCPServer Token Exchange Auth", Ordered, func() {
},
Spec: mcpv1alpha1.MCPServerSpec{
GroupRef: mcpGroupName,
Image: "ghcr.io/stackloklabs/gofetch/server:1.0.1",
Image: images.GofetchServerImage,
Transport: "streamable-http",
ProxyPort: 8080,
McpPort: 8080,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ import (
"k8s.io/apimachinery/pkg/types"

mcpv1alpha1 "github.com/stacklok/toolhive/cmd/thv-operator/api/v1alpha1"
"github.com/stacklok/toolhive/test/e2e/images"
)

// Compile-time check to ensure corev1 is used (for Service type)
var _ = corev1.ServiceSpec{}

// YardstickImage is the container image for the yardstick MCP server
const YardstickImage = "ghcr.io/stackloklabs/yardstick/yardstick-server:0.0.2"
const YardstickImage = images.YardstickServerImage

var _ = Describe("VirtualMCPServer Yardstick Base", Ordered, func() {
var (
Expand Down
Loading