testing

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package testing provides test integration for preview environments. It triggers CI pipeline runs and polls for their completion status.

Index

Constants

This section is empty.

Variables

View Source
var Providers = registry.New[TestRunner]("test-runner")

Providers is the registry of available TestRunner implementations.

Functions

This section is empty.

Types

type GitHubActionsRunner

type GitHubActionsRunner struct {
	BaseURL    string // defaults to https://api.github.com
	Token      string
	HTTPClient *http.Client
}

GitHubActionsRunner triggers and polls GitHub Actions workflow runs.

func (*GitHubActionsRunner) Status

Status checks the current state of a GitHub Actions workflow run.

func (*GitHubActionsRunner) Trigger

Trigger starts a GitHub Actions workflow dispatch event.

type GitLabPipelineRunner

type GitLabPipelineRunner struct {
	BaseURL    string
	Token      string
	HTTPClient *http.Client
}

GitLabPipelineRunner triggers and polls GitLab CI pipelines.

func (*GitLabPipelineRunner) Status

func (*GitLabPipelineRunner) Trigger

type NoopTestRunner

type NoopTestRunner struct{}

NoopTestRunner is a no-op implementation used when testing is not configured.

func (*NoopTestRunner) Status

func (*NoopTestRunner) Trigger

type TestResult

type TestResult struct {
	State   v1alpha1.TestState
	Summary string
	URL     string
	// ResolvedRunID is the actual ID of the run if it was resolved from a pending state.
	ResolvedRunID string
}

TestResult holds the result of a test run poll.

type TestRunner

type TestRunner interface {
	// Trigger starts a test run against the preview environment.
	// Returns an opaque RunID that can be used for subsequent Status polls.
	Trigger(ctx context.Context, env *v1alpha1.Environment) (runID string, err error)

	// Status polls for the current state of a previously triggered test run.
	// Returns a TestResult with State=TestStateRunning while the run is in progress.
	Status(ctx context.Context, env *v1alpha1.Environment, runID string) (*TestResult, error)
}

TestRunner triggers test runs and polls for their completion.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL