stablekarate

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package stablekarate reproduces the legacy DIA component tool's launch_tests step: it runs the test-launcher-back (Karate) STABLE image on the host network against the already-running app and mocks, mounting the feature files and writing the HTML report to the host, and can open that report in a browser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

type DockerClient interface {
	EnsureImage(ctx context.Context, image string) error
	CreateContainer(ctx context.Context, cfg *docker.ContainerConfig) (string, error)
	StartContainer(ctx context.Context, id string) error
	WaitForContainer(ctx context.Context, id string, condition container.WaitCondition) error
	InspectContainer(ctx context.Context, id string) (*dockertypes.ContainerJSON, error)
	GetContainerLogs(ctx context.Context, id string, tail int) (string, error)
	RemoveContainer(ctx context.Context, id string, force bool) error
}

DockerClient is the subset of *docker.Client used by the runner.

type Options

type Options struct {
	Image        string // defaults to the STABLE test-launcher-back image
	Tags         string
	UrlsToBlock  string
	FeaturesPath string // defaults to test/component/features
	ReportsPath  string // defaults to test/component/reports
	Open         bool   // open the HTML report when the run finishes
}

Options configures a Karate run.

type Result

type Result struct {
	Passed     bool
	ExitCode   int
	ReportPath string // path to the HTML summary, if generated
	Duration   time.Duration
}

Result is the outcome of a Karate run.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner runs the Karate launcher container.

func New

func New(d DockerClient, logger *zap.Logger) *Runner

New builds a Runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, opts Options) (*Result, error)

Run executes the Karate suite and returns the result. It assumes the mocks and app are already running (like the legacy "component e").

Jump to

Keyboard shortcuts

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