From 2cde0591eb1b568fd990cc709bd7619822853972 Mon Sep 17 00:00:00 2001 From: Ryotaro Banno Date: Fri, 8 Nov 2024 04:42:22 +0000 Subject: [PATCH] fixup! add unit tests for SetSynchronizing --- internal/controller/mantlebackup_controller_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/controller/mantlebackup_controller_test.go b/internal/controller/mantlebackup_controller_test.go index e6f6bd81..51ec9a26 100644 --- a/internal/controller/mantlebackup_controller_test.go +++ b/internal/controller/mantlebackup_controller_test.go @@ -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 @@ -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()) @@ -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{ @@ -1082,7 +1082,7 @@ var _ = Describe("SetSynchronizing", func() { diffFrom1 *string, name2 string, diffFrom2 *string, - isError bool, + shouldBeError bool, ) { var err error @@ -1117,7 +1117,7 @@ var _ = Describe("SetSynchronizing", func() { Namespace: "", DiffFrom: diffFrom2, }) - if isError { + if shouldBeError { Expect(err).To(HaveOccurred()) } else { Expect(err).NotTo(HaveOccurred())