Skip to content

Commit f881421

Browse files
authored
Merge pull request #1859 from carolynvs/fix-panic
Pass context from integration tests
2 parents 3ddefb4 + 61473b0 commit f881421

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

tests/integration/dependencies_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func cleanupWordpressBundle(p *porter.TestPorter, namespace string) {
105105
err := uninstallOptions.Validate([]string{}, p.Porter)
106106
require.NoError(p.T(), err, "validation of uninstall opts for root bundle failed")
107107

108-
err = p.UninstallBundle(nil, uninstallOptions)
108+
err = p.UninstallBundle(context.Background(), uninstallOptions)
109109
require.NoError(p.T(), err, "uninstall of root bundle failed")
110110

111111
// Verify that the dependency installation is deleted
@@ -130,7 +130,7 @@ func upgradeWordpressBundle(p *porter.TestPorter, namespace string) {
130130
err := upgradeOpts.Validate([]string{}, p.Porter)
131131
require.NoError(p.T(), err, "validation of upgrade opts for root bundle failed")
132132

133-
err = p.UpgradeBundle(nil, upgradeOpts)
133+
err = p.UpgradeBundle(context.Background(), upgradeOpts)
134134
require.NoError(p.T(), err, "upgrade of root bundle failed")
135135

136136
// Verify that the dependency claim is upgraded
@@ -161,7 +161,7 @@ func invokeWordpressBundle(p *porter.TestPorter, namespace string) {
161161
err := invokeOpts.Validate([]string{}, p.Porter)
162162
require.NoError(p.T(), err, "validation of invoke opts for root bundle failed")
163163

164-
err = p.InvokeBundle(nil, invokeOpts)
164+
err = p.InvokeBundle(context.Background(), invokeOpts)
165165
require.NoError(p.T(), err, "invoke of root bundle failed")
166166

167167
// Verify that the dependency claim is invoked
@@ -191,7 +191,7 @@ func uninstallWordpressBundle(p *porter.TestPorter, namespace string) {
191191
err := uninstallOptions.Validate([]string{}, p.Porter)
192192
require.NoError(p.T(), err, "validation of uninstall opts for root bundle failed")
193193

194-
err = p.UninstallBundle(nil, uninstallOptions)
194+
err = p.UninstallBundle(context.Background(), uninstallOptions)
195195
require.NoError(p.T(), err, "uninstall of root bundle failed")
196196

197197
// Verify that the dependency claim is uninstalled

tests/integration/invoke_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestInvokeCustomAction(t *testing.T) {
3737
invokeOpts.Action = "zombies"
3838
err = invokeOpts.Validate([]string{}, p.Porter)
3939
require.NoError(t, err)
40-
err = p.InvokeBundle(nil, invokeOpts)
40+
err = p.InvokeBundle(context.Background(), invokeOpts)
4141
require.NoError(t, err, "invoke should have succeeded")
4242

4343
gotOutput := p.TestConfig.TestContext.GetOutput()

tests/integration/outputs_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func CleanupCurrentBundle(p *porter.TestPorter) {
7575
err := uninstallOpts.Validate([]string{}, p.Porter)
7676
assert.NoError(p.T(), err, "validation of uninstall opts failed for current bundle")
7777

78-
err = p.UninstallBundle(nil, uninstallOpts)
78+
err = p.UninstallBundle(context.Background(), uninstallOpts)
7979
assert.NoError(p.T(), err, "uninstall failed for current bundle")
8080
}
8181

@@ -97,7 +97,7 @@ func invokeExecOutputsBundle(p *porter.TestPorter, action string) {
9797
statusOpts.Action = action
9898
err := statusOpts.Validate([]string{}, p.Porter)
9999
require.NoError(p.T(), err)
100-
err = p.InvokeBundle(nil, statusOpts)
100+
err = p.InvokeBundle(context.Background(), statusOpts)
101101
require.NoError(p.T(), err, "invoke %s should have succeeded", action)
102102
}
103103

@@ -124,14 +124,14 @@ func TestStepLevelAndBundleLevelOutputs(t *testing.T) {
124124
upgradeOpts := porter.NewUpgradeOptions()
125125
err = upgradeOpts.Validate([]string{}, p.Porter)
126126
require.NoError(t, err)
127-
err = p.UpgradeBundle(nil, upgradeOpts)
127+
err = p.UpgradeBundle(context.Background(), upgradeOpts)
128128
require.NoError(t, err, "upgrade should have succeeded")
129129

130130
// Uninstall the bundle
131131
// A bundle-level output will be used during this action
132132
uninstallOpts := porter.NewUninstallOptions()
133133
err = uninstallOpts.Validate([]string{}, p.Porter)
134134
require.NoError(t, err)
135-
err = p.UninstallBundle(nil, uninstallOpts)
135+
err = p.UninstallBundle(context.Background(), uninstallOpts)
136136
require.NoError(t, err, "uninstall should have succeeded")
137137
}

tests/integration/rebuild_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestRebuild_UpgradeModifiedBundle(t *testing.T) {
6666
upgradeOpts := porter.NewUpgradeOptions()
6767
err = upgradeOpts.Validate([]string{}, p.Porter)
6868
require.NoError(t, err)
69-
err = p.UpgradeBundle(nil, upgradeOpts)
69+
err = p.UpgradeBundle(context.Background(), upgradeOpts)
7070
require.NoError(t, err, "upgrade should have succeeded")
7171

7272
gotOutput := p.TestConfig.TestContext.GetOutput()

tests/integration/suppress_output_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ func TestSuppressOutput(t *testing.T) {
4040
err = invokeOpts.Validate([]string{}, p.Porter)
4141
require.NoError(t, err)
4242

43-
err = p.InvokeBundle(nil, invokeOpts)
43+
err = p.InvokeBundle(context.Background(), invokeOpts)
4444
require.NoError(t, err)
4545

4646
// Uninstall
4747
uninstallOpts := porter.NewUninstallOptions()
4848
err = uninstallOpts.Validate([]string{}, p.Porter)
4949
require.NoError(t, err)
5050

51-
err = p.UninstallBundle(nil, uninstallOpts)
51+
err = p.UninstallBundle(context.Background(), uninstallOpts)
5252
require.NoError(t, err)
5353

5454
gotCmdOutput := p.TestConfig.TestContext.GetOutput()

0 commit comments

Comments
 (0)