Skip to content

Commit

Permalink
delete pod after unit test run
Browse files Browse the repository at this point in the history
Signed-off-by: nicklesimba <[email protected]>
  • Loading branch information
nicklesimba committed Jul 24, 2023
1 parent fafc631 commit b48320a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/reconciler/ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ var _ = Describe("Whereabouts IP reconciler", func() {
clusterWideIPAllocations, err := wbClient.WhereaboutsV1alpha1().OverlappingRangeIPReservations(namespace).List(context.TODO(), metav1.ListOptions{})
Expect(err).NotTo(HaveOccurred())
Expect(clusterWideIPAllocations.Items).To(HaveLen(expectedClusterWideIPs))
Expect(k8sClientSet.CoreV1().Pods(namespace).Delete(context.TODO(), pods[0].Name, metav1.DeleteOptions{})).NotTo(HaveOccurred())

This comment has been minimized.

Copy link
@maiqueb

maiqueb Jul 25, 2023

Collaborator

please do this in an AfterEach block. It is part of the test teardown.

Also, when possible, I personally prefer to see positive logic in the tests: i.e. Expect(...).To(Succeed()) rather than checking an error did not occur.

})
})

Expand Down

0 comments on commit b48320a

Please sign in to comment.