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 ¶
var TestScenariosDir = getTestScenariosDir()
TestScenariosDir is the directory containing test scenarios
Functions ¶
This section is empty.
Types ¶
type IntegrationTestSuite ¶
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