test

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultLauncherImage is the Karate backend test launcher image (see
	// test-launcher/). Build it locally with `make test-launcher-image`; override
	// it via NewKarateRunner when needed.
	DefaultLauncherImage = "gtool/test-launcher-back:latest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

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

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

type KarateRunner

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

KarateRunner executes a Karate backend test suite by running the test-launcher-back container against the already-running app and mocks. It satisfies the orchestrator's TestRunner interface.

func NewKarateRunner

func NewKarateRunner(dockerClient DockerClient, image string, logger *zap.Logger) *KarateRunner

NewKarateRunner creates a Karate runner. An empty image uses DefaultLauncherImage.

func (*KarateRunner) Run

Run mounts the feature files into the launcher container, runs it on the host network (so the tests can reach the app and mocks on localhost), and reports the outcome from the container exit code.

type Manager

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

func NewManager

func NewManager(executor plugin.TestExecutor) *Manager

func (*Manager) Execute

func (m *Manager) Execute(ctx context.Context, config *plugin.TestConfig) (*plugin.TestResult, error)

Directories

Path Synopsis
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.
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.

Jump to

Keyboard shortcuts

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