testing

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package testing provides integration test helpers for Deployah scenarios.

Scenario directories under scenarios/ hold sample manifests, environment files, and expected Kubernetes output. DiscoverScenarios finds them automatically; IntegrationTestSuite loads a manifest, generates a chart, renders templates, and compares results to golden files.

Index

Constants

This section is empty.

Variables

View Source
var TestScenariosDir = getTestScenariosDir()

TestScenariosDir is the directory containing test scenarios

Functions

This section is empty.

Types

type IntegrationTestSuite

type IntegrationTestSuite struct {
	ScenariosDir string
	OutputDir    string
}

IntegrationTestSuite provides comprehensive testing using scenario directories

func NewIntegrationTestSuite

func NewIntegrationTestSuite(t *testing.T) *IntegrationTestSuite

NewIntegrationTestSuite creates a new integration test suite

func (*IntegrationTestSuite) RunScenarioTest

func (suite *IntegrationTestSuite) RunScenarioTest(t *testing.T, scenario TestScenario)

RunScenarioTest executes a test for a specific scenario

type TestScenario

type TestScenario struct {
	Name           string
	ScenarioDir    string
	ManifestFile   string
	Environment    string
	EnvFiles       []string
	ExpectedDir    string
	ExpectError    bool     // Simple: just check if error occurs
	ExpectedErrors []string // Advanced: check for specific error messages
}

TestScenario represents a single test scenario

func DiscoverScenarios

func DiscoverScenarios(scenariosDir string) ([]TestScenario, error)

DiscoverScenarios discovers test scenarios from the directory structure.

func LoadScenario

func LoadScenario(scenariosDir, scenarioName string) (*TestScenario, error)

LoadScenario loads a specific scenario by name

func LoadScenarioWithEnvironment

func LoadScenarioWithEnvironment(scenariosDir, scenarioName, environment string) (*TestScenario, error)

LoadScenarioWithEnvironment loads a scenario with a specific environment

Jump to

Keyboard shortcuts

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