Skip to content

Commit

Permalink
Merge pull request #222 from mrkisaolamb/update_harness_test
Browse files Browse the repository at this point in the history
Add method to bump generation in tests
  • Loading branch information
openshift-merge-bot[bot] authored Jun 3, 2024
2 parents 6b70af2 + 0c306d2 commit b02b9f3
Showing 1 changed file with 18 additions and 11 deletions.
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

0 comments on commit b02b9f3

Please sign in to comment.