Skip to content

Commit

Permalink
remove debugging code
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Feb 23, 2024
1 parent 06945a0 commit 6fe49d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
13 changes: 2 additions & 11 deletions pkg/common-controller/framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1262,9 +1262,8 @@ func testSyncContentError(ctrl *csiSnapshotCommonController, reactor *snapshotRe
func testAddPVCFinalizer(ctrl *csiSnapshotCommonController, reactor *snapshotReactor, test controllerTest) error {
return ctrl.ensurePVCFinalizer(test.initialSnapshots[0])
}
var testRemoveInitialSnapshot *crdv1.VolumeSnapshot

func testRemovePVCFinalizer(ctrl *csiSnapshotCommonController, reactor *snapshotReactor, test controllerTest) error {
testRemoveInitialSnapshot = test.initialSnapshots[0]
return ctrl.checkandRemovePVCFinalizer(test.initialSnapshots[0], false)
}

Expand Down Expand Up @@ -1365,16 +1364,9 @@ func evaluateTestResults(ctrl *csiSnapshotCommonController, reactor *snapshotRea
// 2. Call the tested function (syncSnapshot/syncContent) via
// controllerTest.testCall *once*.
// 3. Compare resulting contents and snapshots with expected contents and snapshots.
var thisSnapshotStore *crdv1.VolumeSnapshot
func runSyncTests(t *testing.T, tests []controllerTest, snapshotClasses []*crdv1.VolumeSnapshotClass) {
snapshotscheme.AddToScheme(scheme.Scheme)
for _, test := range tests {
thisTest = &test
if len(test.initialSnapshots) >= 1 {
thisSnapshotStore = test.initialSnapshots[0]
} else {
thisSnapshotStore = nil
}
klog.V(4).Infof("starting test %q", test.name)

// Initialize the controller
Expand Down Expand Up @@ -1432,12 +1424,11 @@ func runSyncTests(t *testing.T, tests []controllerTest, snapshotClasses []*crdv1
evaluateTestResults(ctrl, reactor, test, t)
}
}
var thisTest *controllerTest

// This tests that finalizers are added or removed from a PVC or Snapshot
func runFinalizerTests(t *testing.T, tests []controllerTest, snapshotClasses []*crdv1.VolumeSnapshotClass) {
snapshotscheme.AddToScheme(scheme.Scheme)
for _, test := range tests {
thisTest = &test
klog.V(4).Infof("starting test %q", test.name)
if test.name == "2-3 - successful remove Snapshot finalizer" {
fmt.Println("test.name: ", test.name)
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ func PatchOpsToAddFinalizers(object metav1.Object, finalizers ...string) []Patch
func PatchOpsBytesToAddFinalizers(object metav1.Object, finalizers ...string) ([]byte, error) {
patches := PatchOpsToAddFinalizers(object, finalizers...)
return json.Marshal(patches)
}
}

0 comments on commit 6fe49d4

Please sign in to comment.