Skip to content

Commit

Permalink
Merge pull request #1859 from carolynvs/fix-panic
Browse files Browse the repository at this point in the history
Pass context from integration tests
  • Loading branch information
carolynvs authored Jan 12, 2022
2 parents 3ddefb4 + 61473b0 commit f881421
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions tests/integration/dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func cleanupWordpressBundle(p *porter.TestPorter, namespace string) {
err := uninstallOptions.Validate([]string{}, p.Porter)
require.NoError(p.T(), err, "validation of uninstall opts for root bundle failed")

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

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

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

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

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

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

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

// Verify that the dependency claim is uninstalled
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/invoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestInvokeCustomAction(t *testing.T) {
invokeOpts.Action = "zombies"
err = invokeOpts.Validate([]string{}, p.Porter)
require.NoError(t, err)
err = p.InvokeBundle(nil, invokeOpts)
err = p.InvokeBundle(context.Background(), invokeOpts)
require.NoError(t, err, "invoke should have succeeded")

gotOutput := p.TestConfig.TestContext.GetOutput()
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/outputs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func CleanupCurrentBundle(p *porter.TestPorter) {
err := uninstallOpts.Validate([]string{}, p.Porter)
assert.NoError(p.T(), err, "validation of uninstall opts failed for current bundle")

err = p.UninstallBundle(nil, uninstallOpts)
err = p.UninstallBundle(context.Background(), uninstallOpts)
assert.NoError(p.T(), err, "uninstall failed for current bundle")
}

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

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

// Uninstall the bundle
// A bundle-level output will be used during this action
uninstallOpts := porter.NewUninstallOptions()
err = uninstallOpts.Validate([]string{}, p.Porter)
require.NoError(t, err)
err = p.UninstallBundle(nil, uninstallOpts)
err = p.UninstallBundle(context.Background(), uninstallOpts)
require.NoError(t, err, "uninstall should have succeeded")
}
2 changes: 1 addition & 1 deletion tests/integration/rebuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestRebuild_UpgradeModifiedBundle(t *testing.T) {
upgradeOpts := porter.NewUpgradeOptions()
err = upgradeOpts.Validate([]string{}, p.Porter)
require.NoError(t, err)
err = p.UpgradeBundle(nil, upgradeOpts)
err = p.UpgradeBundle(context.Background(), upgradeOpts)
require.NoError(t, err, "upgrade should have succeeded")

gotOutput := p.TestConfig.TestContext.GetOutput()
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/suppress_output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ func TestSuppressOutput(t *testing.T) {
err = invokeOpts.Validate([]string{}, p.Porter)
require.NoError(t, err)

err = p.InvokeBundle(nil, invokeOpts)
err = p.InvokeBundle(context.Background(), invokeOpts)
require.NoError(t, err)

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

err = p.UninstallBundle(nil, uninstallOpts)
err = p.UninstallBundle(context.Background(), uninstallOpts)
require.NoError(t, err)

gotCmdOutput := p.TestConfig.TestContext.GetOutput()
Expand Down

0 comments on commit f881421

Please sign in to comment.