Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nkubala committed Oct 2, 2018
1 parent 5667e48 commit ad8e298
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
22 changes: 12 additions & 10 deletions pkg/skaffold/deploy/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,19 +252,19 @@ func TestHelmDeploy(t *testing.T) {
{
description: "deploy success",
cmd: &MockHelm{t: t},
deployer: NewHelmDeployer(testDeployConfig, testKubeContext, testNamespace),
deployer: NewHelmDeployer(testDeployConfig, testKubeContext, testNamespace, ""),
builds: testBuilds,
},
{
description: "deploy success with recreatePods",
cmd: &MockHelm{t: t},
deployer: NewHelmDeployer(testDeployRecreatePodsConfig, testKubeContext, testNamespace),
deployer: NewHelmDeployer(testDeployRecreatePodsConfig, testKubeContext, testNamespace, ""),
builds: testBuilds,
},
{
description: "deploy error unmatched parameter",
cmd: &MockHelm{t: t},
deployer: NewHelmDeployer(testDeployConfigParameterUnmatched, testKubeContext, testNamespace),
deployer: NewHelmDeployer(testDeployConfigParameterUnmatched, testKubeContext, testNamespace, ""),
builds: testBuilds,
shouldErr: true,
},
Expand All @@ -284,7 +284,7 @@ func TestHelmDeploy(t *testing.T) {
},
upgradeResult: fmt.Errorf("should not have called upgrade"),
},
deployer: NewHelmDeployer(testDeployConfig, testKubeContext, testNamespace),
deployer: NewHelmDeployer(testDeployConfig, testKubeContext, testNamespace, ""),
builds: testBuilds,
},
{
Expand All @@ -308,7 +308,7 @@ func TestHelmDeploy(t *testing.T) {
},
upgradeResult: fmt.Errorf("should not have called upgrade"),
},
deployer: NewHelmDeployer(testDeployHelmStyleConfig, testKubeContext, testNamespace),
deployer: NewHelmDeployer(testDeployHelmStyleConfig, testKubeContext, testNamespace, ""),
builds: testBuilds,
},
{
Expand All @@ -317,7 +317,7 @@ func TestHelmDeploy(t *testing.T) {
t: t,
installResult: fmt.Errorf("should not have called install"),
},
deployer: NewHelmDeployer(testDeployConfig, testKubeContext, testNamespace),
deployer: NewHelmDeployer(testDeployConfig, testKubeContext, testNamespace, ""),
builds: testBuilds,
},
{
Expand All @@ -327,7 +327,7 @@ func TestHelmDeploy(t *testing.T) {
upgradeResult: fmt.Errorf("unexpected error"),
},
shouldErr: true,
deployer: NewHelmDeployer(testDeployConfig, testKubeContext, testNamespace),
deployer: NewHelmDeployer(testDeployConfig, testKubeContext, testNamespace, ""),
builds: testBuilds,
},
{
Expand All @@ -337,7 +337,7 @@ func TestHelmDeploy(t *testing.T) {
depResult: fmt.Errorf("unexpected error"),
},
shouldErr: true,
deployer: NewHelmDeployer(testDeployConfig, testKubeContext, testNamespace),
deployer: NewHelmDeployer(testDeployConfig, testKubeContext, testNamespace, ""),
builds: testBuilds,
},
{
Expand All @@ -351,6 +351,7 @@ func TestHelmDeploy(t *testing.T) {
testDeployFooWithPackaged,
testKubeContext,
testNamespace,
"",
),
builds: testBuildsFoo,
},
Expand All @@ -365,13 +366,14 @@ func TestHelmDeploy(t *testing.T) {
testDeployFooWithPackaged,
testKubeContext,
testNamespace,
"",
),
builds: testBuildsFoo,
},
{
description: "deploy and get templated release name",
cmd: &MockHelm{t: t},
deployer: NewHelmDeployer(testDeployWithTemplatedName, testKubeContext, testNamespace),
deployer: NewHelmDeployer(testDeployWithTemplatedName, testKubeContext, testNamespace, ""),
builds: testBuilds,
},
}
Expand Down Expand Up @@ -537,7 +539,7 @@ func TestHelmDependencies(t *testing.T) {
SetValues: map[string]string{"some.key": "somevalue"},
},
},
}, testKubeContext, testNamespace)
}, testKubeContext, testNamespace, "")

deps, err := deployer.Dependencies()

Expand Down
6 changes: 3 additions & 3 deletions pkg/skaffold/deploy/kubectl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestKubectlDeploy(t *testing.T) {
util.DefaultExecCommand = test.command
}

k := NewKubectlDeployer(tmpDir.Root(), test.cfg, testKubeContext, testNamespace)
k := NewKubectlDeployer(tmpDir.Root(), test.cfg, testKubeContext, testNamespace, "")
_, err := k.Deploy(context.Background(), ioutil.Discard, test.builds)

testutil.CheckError(t, test.shouldErr, err)
Expand Down Expand Up @@ -199,7 +199,7 @@ func TestKubectlCleanup(t *testing.T) {
util.DefaultExecCommand = test.command
}

k := NewKubectlDeployer(tmpDir.Root(), test.cfg, testKubeContext, testNamespace)
k := NewKubectlDeployer(tmpDir.Root(), test.cfg, testKubeContext, testNamespace, "")
err := k.Cleanup(context.Background(), ioutil.Discard)

testutil.CheckError(t, test.shouldErr, err)
Expand All @@ -219,7 +219,7 @@ func TestKubectlRedeploy(t *testing.T) {
cfg := &latest.KubectlDeploy{
Manifests: []string{"deployment-web.yaml", "deployment-app.yaml"},
}
deployer := NewKubectlDeployer(tmpDir.Root(), cfg, testKubeContext, testNamespace)
deployer := NewKubectlDeployer(tmpDir.Root(), cfg, testKubeContext, testNamespace, "")

// Deploy one manifest
deployed, err := deployer.Deploy(context.Background(), ioutil.Discard, []build.Artifact{
Expand Down

0 comments on commit ad8e298

Please sign in to comment.