Skip to content

Commit

Permalink
e2e: move the channel cleanup under a subtest
Browse files Browse the repository at this point in the history
Earlier, as it was a cleanup function, it would run even after only a
subtest was executed, for example,
TestSuites/Exhaustive/Deployment-rbd-Disapp/Deploy.

This would make the setup unusable thereafter.

Signed-off-by: Raghavendra Talur <[email protected]>
  • Loading branch information
raghavendra-talur committed Oct 26, 2024
1 parent 450dc2d commit bc818e2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions e2e/exhaustive_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ func Exhaustive(t *testing.T) {
t.Fatalf("failed to ensure channel: %v", err)
}

t.Cleanup(func() {
if err := util.EnsureChannelDeleted(); err != nil {
t.Fatalf("failed to ensure channel deleted: %v", err)
}
})

generateWorkloads(Workloads)

for _, workload := range Workloads {
Expand All @@ -91,6 +85,12 @@ func Exhaustive(t *testing.T) {
})
}
}

t.Run("CleanupChannel", func(t *testing.T) {
if err := util.EnsureChannelDeleted(); err != nil {
t.Fatalf("failed to ensure channel deleted: %v", err)
}
})
}

func runTestFlow(t *testing.T, w workloads.Workload, d deployers.Deployer) {
Expand Down

0 comments on commit bc818e2

Please sign in to comment.