Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Sergunov <anton.sergunov@flant.com>
  • Loading branch information
asergunov committed Feb 25, 2025
1 parent bda11a5 commit b27d51e
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions images/agent/src/internal/utils/volume_cleanup_ee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,7 @@ var _ = Describe("Cleaning up volume", func() {
Expect(err).To(MatchError("volume cleanup is not supported in your edition"))
}
}
ItSucceedOnlyWhenFeatureEnabled := func(text string) bool {
return It(text, func() {
doCall()
if feature.VolumeCleanupEnabled() {
Expect(err).ToNot(HaveOccurred())
}
})
}

When("method is unknown", func() {
BeforeEach(func() {
method = "some"
Expand Down Expand Up @@ -111,7 +104,12 @@ var _ = Describe("Cleaning up volume", func() {
device.EXPECT().Close().Return(nil)
}
})
ItSucceedOnlyWhenFeatureEnabled("calls device discard")
It("calls device discard", func() {
doCall()
if feature.VolumeCleanupEnabled() {
Expect(err).ToNot(HaveOccurred())
}
})
})
When("cannot close", func() {
closingError := errors.New("closing error")
Expand Down

0 comments on commit b27d51e

Please sign in to comment.