test

package
v0.1.95 Latest Latest
Warning

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

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

README

Test Command

Run tests against Deckhouse modules. dmt test groups module-level testers that validate rendered output and configuration conversions.

Overview

dmt test <subcommand> [module-path]

dmt test discovers every module under the given path (including subdirectories) and runs the selected tester against each one. A tester is applicable to a module only when that module ships the inputs the tester needs; modules without those inputs are silently skipped.

Results are printed per module:

  • ✅ [<tester>] <module> — the tester ran and passed.
  • ❌ [<tester>] <module> — the tester ran and reported failures (details follow).

If any test reports a critical error, the command exits with a non-zero status.

Subcommands

Subcommand Purpose Documentation
conversions Validate OpenAPI configuration conversions against declared versions and testcases pkg/testers/conversions/README.md
templates Render module templates and compare against committed golden snapshots pkg/testers/templates/README.md

Usage

# Validate conversions for all modules under the current directory
dmt test conversions

# Compare templates against snapshots for a single module
dmt test templates ./modules/my-module

# Refresh snapshots after intentional template changes
dmt test templates ./modules/my-module --update

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(dir string, rootConfig *config.RootConfig, opts ...Option) (*Manager, error)

func (*Manager) GetErrors added in v0.1.77

func (m *Manager) GetErrors() []pkg.TestError

GetErrors returns all test errors collected during the run. It is primarily intended for tests (e.g. the e2e framework) that need to assert on the structured results produced by the testers.

func (*Manager) HasCriticalErrors

func (m *Manager) HasCriticalErrors() bool

func (*Manager) PrintResult

func (m *Manager) PrintResult()

func (*Manager) Run

func (m *Manager) Run()

type Option added in v0.1.83

type Option func(*managerOptions)

Option customizes which testers a Manager runs and how.

func WithTesters added in v0.1.83

func WithTesters(ids ...string) Option

WithTesters restricts the manager to the testers with the given IDs. When omitted, all registered testers run.

func WithUpdateSnapshots added in v0.1.83

func WithUpdateSnapshots(update bool) Option

WithUpdateSnapshots makes snapshot-based testers rewrite their golden files instead of reporting mismatches.

Jump to

Keyboard shortcuts

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