mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-20 06:25:44 +02:00
This commit adds support for running helm-unittest on releases defined in helmfile.
Features:
- Add unittest command to run helm-unittest on releases
- Add unitTests field to release spec for specifying test directories
- Add helm-unittest plugin to init command
- Support for --values, --fail-fast, --color, --debug-plugin, --unittest-args flags
- Concurrent execution support
- Integration with needs/selectors like other commands
Example usage:
helmfile unittest -e test
helmfile unittest --fail-fast --color
helmfile unittest --values values.yaml
Example helmfile.yaml:
releases:
- name: myapp
chart: ./charts/myapp
unitTests:
- tests/
Signed-off-by: yxxhero <aiopsclub@163.com>
49 lines
1.8 KiB
Go
49 lines
1.8 KiB
Go
package helmexec
|
|
|
|
import chart "helm.sh/helm/v4/pkg/chart/v2"
|
|
|
|
// Version represents the version of helm
|
|
type Version struct {
|
|
Major int
|
|
Minor int
|
|
Patch int
|
|
}
|
|
|
|
// Interface for executing helm commands
|
|
type Interface interface {
|
|
SetExtraArgs(args ...string)
|
|
SetHelmBinary(bin string)
|
|
SetEnableLiveOutput(enableLiveOutput bool)
|
|
SetDisableForceUpdate(forceUpdate bool)
|
|
|
|
AddRepo(name, repository, cafile, certfile, keyfile, username, password string, managed string, passCredentials, skipTLSVerify bool) error
|
|
UpdateRepo() error
|
|
RegistryLogin(name, username, password, caFile, certFile, keyFile string, skipTLSVerify bool) error
|
|
BuildDeps(name, chart string, flags ...string) error
|
|
UpdateDeps(chart string) error
|
|
SyncRelease(context HelmContext, name, chart, namespace string, flags ...string) error
|
|
DiffRelease(context HelmContext, name, chart, namespace string, suppressDiff bool, flags ...string) error
|
|
TemplateRelease(name, chart string, flags ...string) error
|
|
UnittestRelease(context HelmContext, name, chart string, flags ...string) error
|
|
Fetch(chart string, flags ...string) error
|
|
ChartPull(chart string, path string, flags ...string) error
|
|
ChartExport(chart string, path string) error
|
|
Lint(name, chart string, flags ...string) error
|
|
ReleaseStatus(context HelmContext, name string, flags ...string) error
|
|
DeleteRelease(context HelmContext, name string, flags ...string) error
|
|
TestRelease(context HelmContext, name string, flags ...string) error
|
|
List(context HelmContext, filter string, flags ...string) (string, error)
|
|
DecryptSecret(context HelmContext, name string, flags ...string) (string, error)
|
|
IsHelm3() bool
|
|
IsHelm4() bool
|
|
GetVersion() Version
|
|
IsVersionAtLeast(versionStr string) bool
|
|
ShowChart(chart string) (chart.Metadata, error)
|
|
}
|
|
|
|
type DependencyUpdater interface {
|
|
UpdateDeps(chart string) error
|
|
IsHelm3() bool
|
|
IsHelm4() bool
|
|
}
|