Skip to content

Commit

Permalink
KUBESAW-248: Drop NSTemplateTier.Status.Updates field (#1088)
Browse files Browse the repository at this point in the history
* KUBESAW-248: Drop NSTemplateTier.Status.Updates field

Signed-off-by: Feny Mehta <[email protected]>

* bringing back the unrelated removal

Signed-off-by: Feny Mehta <[email protected]>

---------

Signed-off-by: Feny Mehta <[email protected]>
Co-authored-by: Matous Jobanek <[email protected]>
  • Loading branch information
fbm3307 and MatousJobanek authored Jan 9, 2025
1 parent d1ae3ba commit 141f720
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
17 changes: 0 additions & 17 deletions test/e2e/parallel/nstemplatetier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,6 @@ func TestUpdateNSTemplateTier(t *testing.T) {
verifyResourceUpdatesForUserSignups(t, hostAwait, memberAwait, cookieUsers, cookieTier)
verifyResourceUpdatesForSpaces(t, hostAwait, memberAwait, spaces, chocolateTier)

// finally, verify the counters in the status.history for both 'cheesecake' and 'cookie' tiers
// cheesecake tier
// there should be 2 entries in the status.history (1 create + 1 update)
verifyStatus(t, hostAwait, "cheesecake", 2)

// cookie tier
// there should be 2 entries in the status.history (1 create + 1 update)
verifyStatus(t, hostAwait, "cookie", 2)

// chocolate tier
// there should be 2 entries in the status.history (1 create + 1 update)
verifyStatus(t, hostAwait, "chocolate", 2)
}

func TestResetDeactivatingStateWhenPromotingUser(t *testing.T) {
Expand Down Expand Up @@ -233,11 +221,6 @@ func setupAccounts(t *testing.T, awaitilities wait.Awaitilities, tier *tiers.Cus
return userSignups
}

func verifyStatus(t *testing.T, hostAwait *wait.HostAwaitility, tierName string, expectedCount int) {
_, err := hostAwait.WaitForNSTemplateTierAndCheckTemplates(t, tierName, wait.UntilNSTemplateTierStatusUpdates(expectedCount))
require.NoError(t, err)
}

func verifyResourceUpdatesForUserSignups(t *testing.T, hostAwait *wait.HostAwaitility, memberAwaitility *wait.MemberAwaitility, userSignups []*toolchainv1alpha1.UserSignup, tier *tiers.CustomNSTemplateTier) {
// if there's an annotation that describes on which other tier this one is based (for e2e tests only)
for _, usersignup := range userSignups {
Expand Down
14 changes: 1 addition & 13 deletions testsupport/wait/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ func (a *HostAwaitility) printUserTierWaitCriterionDiffs(t *testing.T, actual *t
t.Log(buf.String())
}

// UntilUserTierHasDeactivationTimeoutDays verify that the UserTier status.Updates has the specified number of entries
// UntilUserTierHasDeactivationTimeoutDays verify that the UserTier spec.DeactivationTimeoutDays is equal to the expected nummber
func UntilUserTierHasDeactivationTimeoutDays(expected int) UserTierWaitCriterion {
return UserTierWaitCriterion{
Match: func(actual *toolchainv1alpha1.UserTier) bool {
Expand Down Expand Up @@ -1015,18 +1015,6 @@ func UntilNSTemplateTierSpec(matcher NSTemplateTierSpecMatcher) NSTemplateTierWa
}
}

// UntilNSTemplateTierStatusUpdates verify that the NSTemplateTier status.Updates has the specified number of entries
func UntilNSTemplateTierStatusUpdates(expected int) NSTemplateTierWaitCriterion {
return NSTemplateTierWaitCriterion{
Match: func(actual *toolchainv1alpha1.NSTemplateTier) bool {
return len(actual.Status.Updates) == expected
},
Diff: func(actual *toolchainv1alpha1.NSTemplateTier) string {
return fmt.Sprintf("expected status.updates count %d. Actual: %d", expected, len(actual.Status.Updates))
},
}
}

// HasNoTemplateRefWithSuffix checks that ALL namespaces' `TemplateRef` doesn't have the suffix
func HasNoTemplateRefWithSuffix(suffix string) NSTemplateTierSpecMatcher {
return NSTemplateTierSpecMatcher{
Expand Down

0 comments on commit 141f720

Please sign in to comment.