Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e test for helm deployments. #743

Merged
merged 1 commit into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions examples/helm-deployment/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ build:
tagPolicy:
sha256: {}
artifacts:
- imageName: skaffold-helm
- imageName: gcr.io/k8s-skaffold/skaffold-helm
deploy:
helm:
releases:
- name: skaffold-helm
chartPath: skaffold-helm
namespace: skaffold
#wait: true
#valuesFilePath: helm-skaffold-values.yaml
values:
image: skaffold-helm
image: gcr.io/k8s-skaffold/skaffold-helm
#overrides builds an override values.yaml file to run with the helm deploy
#overrides:
# some:
Expand Down
30 changes: 29 additions & 1 deletion integration/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func TestRun(t *testing.T) {
env map[string]string

remoteOnly bool
cleanup func(t *testing.T)
}

var testCases = []testRunCase{
Expand Down Expand Up @@ -171,6 +172,24 @@ func TestRun(t *testing.T) {
dir: "../examples/kaniko",
remoteOnly: true,
},
{
description: "helm example",
args: []string{"run"},
deployments: []testObject{
{
name: "skaffold-helm",
},
},
dir: "../examples/helm-deployment",
remoteOnly: true,
cleanup: func(t *testing.T) {
cmd := exec.Command("helm", "delete", "--purge", "skaffold-helm")
output, err := util.RunCmdOut(cmd)
if err != nil {
t.Fatalf("skaffold: %s %v", output, err)
}
},
},
}

for _, testCase := range testCases {
Expand Down Expand Up @@ -211,6 +230,10 @@ func TestRun(t *testing.T) {
}
testCase.deploymentValidation(t, deployment)
}

if testCase.cleanup != nil {
testCase.cleanup(t)
}
}
})
}
Expand All @@ -233,7 +256,12 @@ func setupNamespace(t *testing.T) (*v1.Namespace, func()) {
t.Fatalf("kubectl config set-context --namespace: %v", err)
}

return ns, func() { client.CoreV1().Namespaces().Delete(ns.Name, &meta_v1.DeleteOptions{}); return }
os.Setenv("SKAFFOLD_DEPLOY_NAMESPACE", namespaceName)

return ns, func() {
client.CoreV1().Namespaces().Delete(ns.Name, &meta_v1.DeleteOptions{})
os.Setenv("SKAFFOLD_DEPLOY_NAMESPACE", "")
}
}
func TestFix(t *testing.T) {
_, deleteNs := setupNamespace(t)
Expand Down