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

Add method to bump generation in tests #222

Merged
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
29 changes: 18 additions & 11 deletions api/test/helpers/harnesses.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,25 @@ type assertsURL func(types.NamespacedName, string, string)

type getsConfigHash func() string

type switchToNewAccount func()

// MariaDBTestHarness describes the parameters for running a series
// of Ginkgo tests which exercise a controller's ability to correctly
// work with MariaDBDatabase / MariaDBAccount APIs.
type MariaDBTestHarness struct {
description string
namespace string
databaseName string
finalizerName string
PopulateHarness populateHarness
SetupCR establishesCR
UpdateAccount updatesAccountName
DeleteCR deletesCR
mariaDBHelper *TestHelper
timeout time.Duration
interval time.Duration
description string
namespace string
databaseName string
finalizerName string
PopulateHarness populateHarness
SetupCR establishesCR
UpdateAccount updatesAccountName
DeleteCR deletesCR
SwitchToNewAccount switchToNewAccount
mariaDBHelper *TestHelper
timeout time.Duration
interval time.Duration
runUpdate bool
}

func (harness *MariaDBTestHarness) Setup(
Expand Down Expand Up @@ -286,6 +290,9 @@ func (harness *MariaDBTestHarness) RunBasicSuite() {
harness.UpdateAccount(newAccountName)
harness.mariaDBHelper.SimulateMariaDBAccountCompleted(newAccountName)

if harness.SwitchToNewAccount != nil {
harness.SwitchToNewAccount()
}
mariaDBHelper.Logger.Info(
fmt.Sprintf("Service should move to run fully off MariaDBAccount %s and remove finalizer from %s",
newAccountName, oldAccountName),
Expand Down
Loading