diff --git a/test/e2e/parallel/registration_service_test.go b/test/e2e/parallel/registration_service_test.go index c21bb30bf..4b327f4a9 100644 --- a/test/e2e/parallel/registration_service_test.go +++ b/test/e2e/parallel/registration_service_test.go @@ -372,7 +372,7 @@ func TestSignupOK(t *testing.T) { }) require.NoError(t, err) _, err = hostAwait.WaitForUserSignup(t, userSignup.Name, - wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.ApprovedByAdmin(), wait.DeactivatedWithoutPreDeactivation())...), + wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.DeactivatedWithoutPreDeactivation())...), wait.UntilUserSignupHasStateLabel(toolchainv1alpha1.UserSignupStateLabelValueDeactivated)) require.NoError(t, err) require.NoError(t, hostAwait.WaitUntilSpaceAndSpaceBindingsDeleted(t, userSignup.Status.CompliantUsername)) diff --git a/test/e2e/user_management_test.go b/test/e2e/user_management_test.go index 46c6176e9..550646922 100644 --- a/test/e2e/user_management_test.go +++ b/test/e2e/user_management_test.go @@ -265,7 +265,7 @@ func (s *userManagementTestSuite) TestUserDeactivation() { require.NoError(t, err) userSignupMember1, err = hostAwait.WaitForUserSignup(t, userSignupMember1.Name, - wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.ApprovedByAdmin(), wait.Deactivated())...), + wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Deactivated())...), wait.UntilUserSignupHasStateLabel(toolchainv1alpha1.UserSignupStateLabelValueDeactivated)) require.NoError(t, err) require.True(t, states.Deactivated(userSignupMember1), "usersignup should be deactivated") @@ -502,7 +502,7 @@ func (s *userManagementTestSuite) TestUserDeactivation() { // Since the config for retention days is set to 0, the account should be deactivated again immediately userSignup, err = hostAwait.WaitForUserSignup(t, userSignup.Name, - wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.ApprovedByAdmin(), wait.DeactivatedWithoutNotification())...), + wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.DeactivatedWithoutNotification())...), wait.UntilUserSignupHasStateLabel(toolchainv1alpha1.UserSignupStateLabelValueDeactivated)) require.NoError(t, err) require.True(t, states.Deactivated(userSignup), "usersignup should be deactivated") diff --git a/test/metrics/metrics_test.go b/test/metrics/metrics_test.go index da4f74931..bca8ba4ae 100644 --- a/test/metrics/metrics_test.go +++ b/test/metrics/metrics_test.go @@ -138,7 +138,7 @@ func TestMetricsWhenUsersManuallyApprovedAndThenDeactivated(t *testing.T) { hostAwait.WaitForMetricDelta(t, wait.UserSignupsMetric, 2) // all signups (even if deactivated) hostAwait.WaitForMetricDelta(t, wait.UsersPerActivationsAndDomainMetric, 2, "activations", "1", "domain", "internal") // all deactivated (but this metric is never decremented) hostAwait.WaitForMetricDelta(t, wait.UsersPerActivationsAndDomainMetric, 0, "activations", "1", "domain", "external") // never incremented - hostAwait.WaitForMetricDelta(t, wait.UserSignupsApprovedMetric, 0) // all deactivated (but counters are never decremented) + hostAwait.WaitForMetricDelta(t, wait.UserSignupsApprovedMetric, 2) // all deactivated (but counters are never decremented) hostAwait.WaitForMetricDelta(t, wait.UserSignupsApprovedWithMethodMetric, 0, "method", "automatic") // all deactivated (but counters are never decremented) hostAwait.WaitForMetricDelta(t, wait.UserSignupsApprovedWithMethodMetric, 2, "method", "manual") // all deactivated (but counters are never decremented) hostAwait.WaitForMetricDelta(t, wait.UserSignupsDeactivatedMetric, 2) // all deactivated diff --git a/testsupport/wait/conditions.go b/testsupport/wait/conditions.go index 9f3f3b443..edb2df8bc 100644 --- a/testsupport/wait/conditions.go +++ b/testsupport/wait/conditions.go @@ -235,7 +235,6 @@ func DeactivatedWithoutPreDeactivation() []toolchainv1alpha1.Condition { Status: corev1.ConditionFalse, Reason: toolchainv1alpha1.UserSignupUserDeactivatedReason, }, - } } @@ -251,6 +250,11 @@ func DeactivatedWithoutNotification() []toolchainv1alpha1.Condition { Status: corev1.ConditionFalse, Reason: "UserIsActive", }, + { + Type: toolchainv1alpha1.UserSignupApproved, + Status: corev1.ConditionFalse, + Reason: toolchainv1alpha1.UserSignupUserDeactivatedReason, + }, } } @@ -291,6 +295,11 @@ func Deactivated() []toolchainv1alpha1.Condition { Status: corev1.ConditionTrue, Reason: "NotificationCRCreated", }, + { + Type: toolchainv1alpha1.UserSignupApproved, + Status: corev1.ConditionFalse, + Reason: toolchainv1alpha1.UserSignupUserDeactivatedReason, + }, } }