Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Assertion ¶
type Assertion struct { Template string DocumentIndex int Not bool AssertType string // contains filtered or unexported fields }
Assertion defines target and metrics to validate rendered result
func (*Assertion) Assert ¶
func (a *Assertion) Assert( templatesResult map[string][]common.K8sManifest, snapshotComparer validators.SnapshotComparer, result *AssertionResult, ) *AssertionResult
Assert validate the rendered manifests with validator
func (*Assertion) UnmarshalYAML ¶
UnmarshalYAML implement yaml.Unmalshaler, construct validator according to the assert type
type AssertionResult ¶
type AssertionResult struct { Index int FailInfo []string Passed bool AssertType string Not bool CustomInfo string }
AssertionResult result return by Assertion.Assert
type TestConfig ¶
TestConfig stores config setup by user in command line
type TestJob ¶
type TestJob struct { Name string `yaml:"it"` Values []string Set map[string]interface{} Assertions []*Assertion `yaml:"asserts"` Release struct { Name string Namespace string Revision int IsUpgrade bool } // contains filtered or unexported fields }
TestJob defintion of a test, including values and assertions
func (*TestJob) Run ¶
func (t *TestJob) Run( targetChart *chart.Chart, cache *snapshot.Cache, result *TestJobResult, ) *TestJobResult
Run render the chart and validate it with assertions in TestJob
type TestJobResult ¶
type TestJobResult struct { DisplayName string Index int Passed bool ExecError error AssertsResult []*AssertionResult }
TestJobResult result return by TestJob.Run
type TestRunner ¶
type TestRunner struct { Printer *Printer Config TestConfig // contains filtered or unexported fields }
TestRunner stores basic settings and testing status for running all tests
func (*TestRunner) Run ¶
func (tr *TestRunner) Run(ChartPaths []string) bool
Run test suites in chart in ChartPaths
type TestSuite ¶
type TestSuite struct { Name string `yaml:"suite"` Templates []string Tests []*TestJob // contains filtered or unexported fields }
TestSuite defines scope and templates to render and tests to run
func ParseTestSuiteFile ¶
ParseTestSuiteFile parse a suite file at path and returns TestSuite
func (*TestSuite) Run ¶
func (s *TestSuite) Run( targetChart *chart.Chart, snapshotCache *snapshot.Cache, result *TestSuiteResult, ) *TestSuiteResult
Run runs all the test jobs defined in TestSuite