mirror of
https://github.com/ipedrazas/drone-helm.git
synced 2026-06-26 15:52:33 +08:00
test added
This commit is contained in:
@@ -169,6 +169,33 @@ func TestDetHelmInit(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDetHelmInitClient(t *testing.T) {
|
||||
plugin := &Plugin{
|
||||
Config: Config{
|
||||
HelmCommand: nil,
|
||||
Namespace: "default",
|
||||
SkipTLSVerify: true,
|
||||
Debug: true,
|
||||
DryRun: true,
|
||||
Chart: "./chart/test",
|
||||
Release: "test-release",
|
||||
Prefix: "MY",
|
||||
Values: "image.tag=$TAG,api=${API_SERVER},nameOverride=my-over-app,second.tag=${TAG}",
|
||||
ClientOnly: true,
|
||||
},
|
||||
}
|
||||
init := doHelmInit(plugin)
|
||||
result := strings.Join(init, " ")
|
||||
expected := "init "
|
||||
if plugin.Config.ClientOnly {
|
||||
expected = expected + "--client-only"
|
||||
}
|
||||
|
||||
if expected != result {
|
||||
t.Error("Helm cannot init in client only")
|
||||
}
|
||||
}
|
||||
|
||||
func TestResolveSecretsFallback(t *testing.T) {
|
||||
tag := "v0.1.1"
|
||||
api := "http://apiserver"
|
||||
|
||||
Reference in New Issue
Block a user