mirror of
https://github.com/ipedrazas/drone-helm.git
synced 2026-06-26 15:52:33 +08:00
46 lines
845 B
Go
46 lines
845 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestInitialiseKubeconfig(t *testing.T) {
|
|
|
|
cmd := make([]string, 2)
|
|
cmd[0] = "install"
|
|
cmd[1] = "--debug"
|
|
|
|
plugin := Plugin{
|
|
Config: Config{
|
|
APIServer: "http://myapiserver",
|
|
Token: "secret-token",
|
|
HelmCommand: cmd,
|
|
Namespace: "default",
|
|
SkipTLSVerify: true,
|
|
},
|
|
}
|
|
|
|
initialiseKubeconfig(&plugin.Config, "kubeconfig", "config3.test")
|
|
|
|
}
|
|
|
|
func TestGetHelmCommand(t *testing.T) {
|
|
plugin := &Plugin{
|
|
Config: Config{
|
|
APIServer: "http://myapiserver",
|
|
Token: "secret-token",
|
|
HelmCommand: nil,
|
|
Namespace: "default",
|
|
SkipTLSVerify: true,
|
|
Debug: true,
|
|
DryRun: true,
|
|
Chart: "./chart/test",
|
|
Release: "test-release",
|
|
},
|
|
}
|
|
setHelmCommand(plugin)
|
|
fmt.Println(plugin.Config.HelmCommand)
|
|
|
|
}
|