Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CapabilitiesSpec ¶
type CapabilitiesSpec struct { // KubeVersion represents the kubernetes version which is discoverable via `.Capabilities.KubeVersion`. KubeVersion *KubeVersion `json:"kubeVersion,omitempty" yaml:"kubeVersion,omitempty"` }
CapabilitiesSpec represents the `Capabilities` in Helm.
type KubeVersion ¶
type KubeVersion struct { Version string `json:"version,omitempty" yaml:"version,omitempty"` // i.e. v1.18 Major string `json:"major,omitempty" yaml:"major,omitempty"` // i.e. 1 Minor string `json:"minor,omitempty" yaml:"minor,omitempty"` // i.e. 18 }
KubeVersion is the Kubernetes version.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader loads a test suite.
type LoaderOpt ¶
type LoaderOpt func(loader *Loader)
LoaderOpt allows setting custom options.
func WithAdditionalTestDirs ¶
WithAdditionalTestDirs adds additional test source directories which are scanned for tests.
type RawDict ¶
type RawDict map[string]interface{}
RawDict is an alias for map[string]interface{}, that is needed because `yaml.Unmarshal` and `json.Unmarshal` differ in that the latter will never produce int values, while the former may.
type ReleaseSpec ¶
type ReleaseSpec struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` Revision *int `json:"revision,omitempty" yaml:"revision,omitempty"` IsInstall *bool `json:"isInstall,omitempty" yaml:"isInstall,omitempty"` IsUpgrade *bool `json:"isUpgrade,omitempty" yaml:"isUpgrade,omitempty"` }
ReleaseSpec specifies how the release options for Helm will be constructed.
type ServerSpec ¶
type ServerSpec struct { // AvailableSchemas are the names of schemas that are available on the server (i.e., that rendered objects must // pass validation against, but not necessarily discoverable via `.Capabilities.APIVersions`). AvailableSchemas []string `json:"availableSchemas,omitempty" yaml:"availableSchemas,omitempty"` // VisibleSchemas are the names of schemas that are available on the server AND discoverable via // `.Capabilities.APIVersions`. VisibleSchemas []string `json:"visibleSchemas,omitempty" yaml:"visibleSchemas,omitempty"` // Objects are definitions of objects visible to Helm's k8s client, for example via the `lookup` function. Objects []map[string]interface{} `json:"objects,omitempty" yaml:"objects,omitempty"` // NoInherit indicates that server-side settings should *not* be inherited from the enclosing scope. NoInherit bool `json:"noInherit,omitempty" yaml:"noInherit,omitempty"` }
ServerSpec specifies how the model of the server will be constructed.
type Target ¶
type Target struct { Chart *chart.Chart ReleaseOptions chartutil.ReleaseOptions Capabilities *chartutil.Capabilities SchemaRegistry schemas.Registry }
Target is the target to run a test against. This must at the minimum include a chart and default release options (such as the release name or the namespace). Capabilities is optional and will default to the standard capabilities used by Helm in client-only mode.
type Test ¶
type Test struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Values RawDict `json:"values,omitempty" yaml:"values,omitempty"` Set RawDict `json:"set,omitempty" yaml:"set,omitempty"` Defs string `json:"defs,omitempty" yaml:"defs,omitempty"` Release *ReleaseSpec `json:"release,omitempty" yaml:"release,omitempty"` Server *ServerSpec `json:"server,omitempty" yaml:"server,omitempty"` Capabilities *CapabilitiesSpec `json:"capabilities,omitempty" yaml:"capabilities,omitempty"` Expect string `json:"expect,omitempty" yaml:"expect,omitempty"` ExpectError *bool `json:"expectError,omitempty" yaml:"expectError,omitempty"` Tests []*Test `json:"tests,omitempty" yaml:"tests,omitempty"` // contains filtered or unexported fields }
Test defines a helmtest test. A Test can be regarded as the equivalent of the *testing.T scope of a Go unit test. Tests are scoped, and a test may either define concrete expectations, or contain an arbitrary number of nested tests. See README.md in this directory for a more detailed explanation.