testrunner

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testrunner implements `flate test`.

The runner takes the post-reconcile state of the orchestrator and reports it in a pytest-like progress format. It does NOT shell out to the Go toolchain — every check is performed natively against the Store. A test "passes" when its Kustomization (and every nested HelmRelease) reached Status.Ready; it "fails" otherwise. Resources that were skipped by --path-orig change filtering are reported as SKIPPED so users see what flate actually did.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Case

type Case struct {
	ID      manifest.NamedResource
	Outcome Outcome
	Reason  string
}

Case is one Kustomization (or HelmRelease) result.

type Job

type Job struct {
	Store *store.Store
	// Kinds limits the kinds reported on. Empty ↦ both Kustomization
	// and HelmRelease.
	Kinds []string
	// Name optionally narrows the report to a single resource.
	Name string
	// Include optionally narrows the report by resource identity.
	// Nil includes every resource that passes Kinds and Name.
	Include func(manifest.NamedResource) bool
}

Job collects the orchestrator's post-run state.

type Outcome

type Outcome int

Outcome enumerates the per-resource result.

const (
	OutcomePassed Outcome = iota
	OutcomeSkipped
	OutcomeFailed
)

Possible Outcome values.

type Report

type Report struct {
	Cases   []Case
	Passed  int
	Skipped int
	Failed  int
	Matched int
}

Report is the aggregate outcome.

func Run

func Run(j Job) Report

Run inspects the store and produces a Report. When j.Kinds is empty, both reconciler-driven kinds (Kustomization, HelmRelease) are reported on.

func (Report) AnyFailed

func (r Report) AnyFailed() bool

AnyFailed reports whether any case failed.

func (Report) Write

func (r Report) Write(w io.Writer, color bool, elapsed time.Duration) error

Write renders the report: one row per case (status glyph, dimmed kind column, namespace/name, dimmed reason) followed by a summary — an overall verdict glyph, the colored counts, and a dim elapsed clock (omitted when zero). color gates the ANSI codes — the caller decides based on the sink (see cli.test).

Jump to

Keyboard shortcuts

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