container_structure_test

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectTestDefinitions

func CollectTestDefinitions(distDir string) []string

CollectTestDefinitions finds test YAML files in a rendered dist directory's tests/ subfolder. Only top-level files are included (subdirectories are skipped).

func ReportFileName

func ReportFileName(reportDir, imageTag string) string

ReportFileName returns a JUnit report file path for the given image tag, replacing colons with hyphens to produce a valid file name.

Types

type TestRunner

type TestRunner struct {
	TestDefinitionPaths []string
	Image               string
	Platform            string
	ReportFile          string
	DockerClient        *docker.Client
}

TestRunner executes container structure tests against a Docker image and produces JUnit reports.

func NewRunner

func NewRunner(platform string) (*TestRunner, error)

NewRunner creates a TestRunner with a Docker client for the given platform.

func (*TestRunner) Close

func (t *TestRunner) Close() error

Close releases the Docker client resources.

func (*TestRunner) Run

func (t *TestRunner) Run(ctx context.Context) error

Run resolves the test image, executes all configured test definitions, and writes a JUnit report.

func (*TestRunner) RunTestsForImage

func (t *TestRunner) RunTestsForImage(ctx context.Context, imageSource string, testDefs []string, reportFile string) error

RunTestsForImage executes container structure tests against the given image source.

Jump to

Keyboard shortcuts

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