Skip to content

Commit

Permalink
fixup! add unit tests for SetSynchronizing
Browse files Browse the repository at this point in the history
  • Loading branch information
ushitora-anqou committed Nov 8, 2024
1 parent c07278f commit 2cde059
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/controller/mantlebackup_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ var _ = Describe("prepareForDataSynchronization", func() {
var _ = Describe("SetSynchronizing", func() {
doTestCallOnce := func(
target, source *mantlev1.MantleBackup,
isError bool,
shouldBeError bool,
check func(target, source *mantlev1.MantleBackup) error,
) {
var err error
Expand Down Expand Up @@ -980,7 +980,7 @@ var _ = Describe("SetSynchronizing", func() {
Namespace: backupNamespace,
DiffFrom: diffFrom,
})
if isError {
if shouldBeError {
Expect(err).To(HaveOccurred())
} else {
Expect(err).NotTo(HaveOccurred())
Expand Down Expand Up @@ -1060,7 +1060,7 @@ var _ = Describe("SetSynchronizing", func() {
},
),
Entry(
"a backup should fail if target's ReadToUse is True",
"a backup should fail if target's ReadyToUse is True",
&mantlev1.MantleBackup{
Status: mantlev1.MantleBackupStatus{
Conditions: []metav1.Condition{
Expand All @@ -1082,7 +1082,7 @@ var _ = Describe("SetSynchronizing", func() {
diffFrom1 *string,
name2 string,
diffFrom2 *string,
isError bool,
shouldBeError bool,
) {
var err error

Expand Down Expand Up @@ -1117,7 +1117,7 @@ var _ = Describe("SetSynchronizing", func() {
Namespace: "",
DiffFrom: diffFrom2,
})
if isError {
if shouldBeError {
Expect(err).To(HaveOccurred())
} else {
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit 2cde059

Please sign in to comment.