Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Assertion ¶
type Assertion struct { Template string DocumentIndex int DocumentSelector *valueutils.DocumentSelector 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, renderSucceed bool, renderError error, result *results.AssertionResult, ) *results.AssertionResult
Assert validate the rendered manifests with validator
func (*Assertion) UnmarshalYAML ¶
UnmarshalYAML implement yaml.Unmalshaler, construct validator according to the assert type
type KubernetesFakeClientProvider ¶ added in v0.5.0
type KubernetesFakeClientProvider struct { Scheme map[string]KubernetesFakeKindProps `yaml:"scheme"` Objects []map[string]interface{} `yaml:"objects"` }
func (*KubernetesFakeClientProvider) GetClientFor ¶ added in v0.5.0
func (p *KubernetesFakeClientProvider) GetClientFor(apiVersion, kind string) (dynamic.NamespaceableResourceInterface, bool, error)
type KubernetesFakeKindProps ¶ added in v0.5.0
type KubernetesFakeKindProps struct { ShouldErr error `yaml:"should_err"` Gvr schema.GroupVersionResource `yaml:"gvr"` Namespaced bool `yaml:"namespaced"` }
type TestJob ¶
type TestJob struct { Name string `yaml:"it"` Values []string Set map[string]interface{} Template string Templates []string DocumentIndex *int `yaml:"documentIndex"` DocumentSelector *valueutils.DocumentSelector `yaml:"documentSelector"` Release struct { Name string Namespace string Revision int IsUpgrade bool `yaml:"upgrade"` } Chart struct { Version string AppVersion string `yaml:"appVersion"` } Capabilities struct { MajorVersion string `yaml:"majorVersion"` MinorVersion string `yaml:"minorVersion"` APIVersions []string `yaml:"apiVersions"` } Assertions []*Assertion `yaml:"asserts"` KubernetesProvider KubernetesFakeClientProvider `yaml:"kubernetesProvider"` // contains filtered or unexported fields }
TestJob definition of a test, including values and assertions
type TestRunner ¶
type TestRunner struct { Printer *printer.Printer Formatter formatter.Formatter UpdateSnapshot bool WithSubChart bool Strict bool Failfast bool TestFiles []string ChartTestsPath string ValuesFiles []string OutputFile string RenderPath string // contains filtered or unexported fields }
TestRunner stores basic settings and testing status for running all tests
func (*TestRunner) RunV3 ¶
func (tr *TestRunner) RunV3(ChartPaths []string) bool
RunV3 test suites in chart in ChartPaths.
type TestSuite ¶
type TestSuite struct { Name string `yaml:"suite"` Values []string Set map[string]interface{} Templates []string Release struct { Name string Namespace string Revision int IsUpgrade bool `yaml:"upgrade"` } Chart struct { Version string AppVersion string `yaml:"appVersion"` } Capabilities struct { MajorVersion string `yaml:"majorVersion"` MinorVersion string `yaml:"minorVersion"` APIVersions []string `yaml:"apiVersions"` } KubernetesProvider KubernetesFakeClientProvider `yaml:"kubernetesProvider"` Tests []*TestJob // An identifier to append to snapshot files SnapshotId string `yaml:"snapshotId"` // contains filtered or unexported fields }
TestSuite defines scope and templates to render and tests to run
func ParseTestSuiteFile ¶
func ParseTestSuiteFile(suiteFilePath, chartRoute string, strict bool, valueFilesSet []string) ([]*TestSuite, error)
ParseTestSuiteFile parse a suite file that contain one or more suites at path and returns an array of TestSuite
func RenderTestSuiteFiles ¶ added in v0.3.6
func RenderTestSuiteFiles(helmTestSuiteDir string, chartRoute string, strict bool, valueFilesSet []string, renderValues map[string]interface{}) ([]*TestSuite, error)
RenderTestSuiteFiles renders a helm suite of test files and returns their TestSuites
func (*TestSuite) RunV3 ¶
func (s *TestSuite) RunV3( chartPath string, snapshotCache *snapshot.Cache, failfast bool, renderPath string, result *results.TestSuiteResult, ) *results.TestSuiteResult
RunV3 runs all the test jobs defined in TestSuite.