Skip to content

Commit 16d32d1

Browse files
committed
clean up the spaces after the test so that the ns template tier is deletable
1 parent eecfa1c commit 16d32d1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/e2e/parallel/nstemplatetier_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ func setupSpaces(t *testing.T, awaitilities wait.Awaitilities, tier *tiers.Custo
184184
name := fmt.Sprintf(nameFmt, i)
185185
s, _, _ := CreateSpace(t, awaitilities, testspace.WithName(name), testspace.WithTierNameAndHashLabelFor(tier.NSTemplateTier), testspace.WithSpecTargetCluster(targetCluster.ClusterName))
186186
spaces = append(spaces, s.Name)
187+
t.Cleanup(func() {
188+
cl := awaitilities.Host().Client
189+
fresh := &toolchainv1alpha1.Space{}
190+
require.NoError(t, cl.Get(context.TODO(), client.ObjectKeyFromObject(s), fresh))
191+
require.NoError(cl.Delete(context.TODO(), fresh))
192+
})
187193
}
188194
return spaces
189195
}
@@ -479,7 +485,6 @@ func TestTierTemplateRevision(t *testing.T) {
479485
Value: "100",
480486
})
481487
})
482-
483488
})
484489

485490
t.Run("when updating one tiertemplate the revisions field should be cleaned up from old entries", func(t *testing.T) {
@@ -517,7 +522,6 @@ func TestTierTemplateRevision(t *testing.T) {
517522
// revisions values should be different compared to the previous ones
518523
assert.NotEqual(t, revisionsBeforeUpdate, updatedTier.Status.Revisions)
519524
})
520-
521525
}
522526

523527
func getTestCRQ(podsCount string) unstructured.Unstructured {

0 commit comments

Comments
 (0)