{"modulePath":"github.com/stackrox/helmtest","version":"v0.0.9","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package framework\n\n## Types\n\n```go\ntype CapabilitiesSpec struct {\n\t// KubeVersion represents the kubernetes version which is discoverable via `.Capabilities.KubeVersion`.\n\tKubeVersion *KubeVersion `json:\"kubeVersion,omitempty\" yaml:\"kubeVersion,omitempty\"`\n}\n```\nCapabilitiesSpec represents the \\`Capabilities\\` in Helm.\n\n```go\ntype KubeVersion struct {\n\tVersion string `json:\"version,omitempty\" yaml:\"version,omitempty\"` // i.e. v1.18\n\tMajor   string `json:\"major,omitempty\" yaml:\"major,omitempty\"`     // i.e. 1\n\tMinor   string `json:\"minor,omitempty\" yaml:\"minor,omitempty\"`     // i.e. 18\n}\n```\nKubeVersion is the Kubernetes version.\n\n```go\ntype Loader struct {\n\t// contains filtered or unexported fields\n}\n```\nLoader loads a test suite.\n\n```go\nfunc NewLoader(rootDir string, opts ...LoaderOpt) *Loader\n```\nNewLoader returns a loader and applies options to it.\n\n```go\nfunc (loader *Loader) LoadSuite() (*Test, error)\n```\nLoadSuite loads a helmtest suite from the given directory.\n\n```go\ntype LoaderOpt func(loader *Loader)\n```\nLoaderOpt allows setting custom options.\n\n```go\nfunc WithAdditionalTestDirs(path ...string) LoaderOpt\n```\nWithAdditionalTestDirs adds additional test source directories which are scanned for tests.\n\n```go\ntype RawDict map[string]interface{}\n```\nRawDict 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.\n\n```go\nfunc (d *RawDict) UnmarshalYAML(node *yamlv3.Node) error\n```\nUnmarshalYAML unmarshals a RawDict from YAML, making sure that the resulting type matches the result of json.Unmarshal on the equivalent JSON.\n\n```go\ntype ReleaseSpec struct {\n\tName      string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\tNamespace string `json:\"namespace,omitempty\" yaml:\"namespace,omitempty\"`\n\tRevision  *int   `json:\"revision,omitempty\" yaml:\"revision,omitempty\"`\n\tIsInstall *bool  `json:\"isInstall,omitempty\" yaml:\"isInstall,omitempty\"`\n\tIsUpgrade *bool  `json:\"isUpgrade,omitempty\" yaml:\"isUpgrade,omitempty\"`\n}\n```\nReleaseSpec specifies how the release options for Helm will be constructed.\n\n```go\ntype ServerSpec struct {\n\t// AvailableSchemas are the names of schemas that are available on the server (i.e., that rendered objects must\n\t// pass validation against, but not necessarily discoverable via `.Capabilities.APIVersions`).\n\tAvailableSchemas []string `json:\"availableSchemas,omitempty\" yaml:\"availableSchemas,omitempty\"`\n\t// VisibleSchemas are the names of schemas that are available on the server AND discoverable via\n\t// `.Capabilities.APIVersions`.\n\tVisibleSchemas []string `json:\"visibleSchemas,omitempty\" yaml:\"visibleSchemas,omitempty\"`\n\t// Objects are definitions of objects visible to Helm's k8s client, for example via the `lookup` function.\n\tObjects []map[string]interface{} `json:\"objects,omitempty\" yaml:\"objects,omitempty\"`\n\n\t// NoInherit indicates that server-side settings should *not* be inherited from the enclosing scope.\n\tNoInherit bool `json:\"noInherit,omitempty\" yaml:\"noInherit,omitempty\"`\n}\n```\nServerSpec specifies how the model of the server will be constructed.\n\n```go\ntype Target struct {\n\tChart          *chart.Chart\n\tReleaseOptions chartutil.ReleaseOptions\n\tCapabilities   *chartutil.Capabilities\n\n\tSchemaRegistry schemas.Registry\n}\n```\nTarget 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.\n\n```go\ntype Test struct {\n\tName string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\n\tValues RawDict `json:\"values,omitempty\" yaml:\"values,omitempty\"`\n\tSet    RawDict `json:\"set,omitempty\" yaml:\"set,omitempty\"`\n\n\tDefs         string            `json:\"defs,omitempty\" yaml:\"defs,omitempty\"`\n\tRelease      *ReleaseSpec      `json:\"release,omitempty\" yaml:\"release,omitempty\"`\n\tServer       *ServerSpec       `json:\"server,omitempty\" yaml:\"server,omitempty\"`\n\tCapabilities *CapabilitiesSpec `json:\"capabilities,omitempty\" yaml:\"capabilities,omitempty\"`\n\n\tExpect      string `json:\"expect,omitempty\" yaml:\"expect,omitempty\"`\n\tExpectError *bool  `json:\"expectError,omitempty\" yaml:\"expectError,omitempty\"`\n\n\tTests []*Test `json:\"tests,omitempty\" yaml:\"tests,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nTest 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.\n\n```go\nfunc (t *Test) DoRun(testingT *testing.T, tgt *Target)\n```\nDoRun runs a test directly, without an intermediate \\`testingT.Run\\` invocation.\n\n```go\nfunc (t *Test) Run(testingT *testing.T, tgt *Target)\n```\nRun runs a test against the given target.\n\n```go\nfunc (t *Test) UnmarshalYAML(node *yamlv3.Node) error\n```\nUnmarshalYAML unmarshals a test spec from YAML, preserving line information that we're interested in.\n\n","path":"github.com/stackrox/helmtest/pkg/framework","name":"framework","synopsis":"","isRedistributable":true}
