Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set approved to false after user sign up deactivated #801

Conversation

mmulholla
Copy link
Contributor

@mmulholla mmulholla commented Sep 29, 2023

Working on getting e2e tests working.

re: codeready-toolchain/host-operator#868

@openshift-ci
Copy link

openshift-ci bot commented Sep 29, 2023

Hi @mmulholla. Thanks for your PR.

I'm waiting for a codeready-toolchain member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -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, 2) // all deactivated (but counters are never decremented)
hostAwait.WaitForMetricDelta(t, wait.UserSignupsApprovedMetric, 0) // all deactivated (but counters are never decremented)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the counter will be decremented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did pass when I ran it locally.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird. AFAIK the "approved" metric is not supposed to decrement. @xcoulon can you confirm?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmulholla from the failure here: https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/codeready-toolchain_toolchain-e2e/801/pull-ci-codeready-toolchain-toolchain-e2e-master-e2e/1708871838563569664/build-log.txt
it is failing on the parallel test suite, so it has not yet ran the metrics test suite.

I think you still have to update those conditions:

wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.ApprovedByAdmin(), wait.DeactivatedWithoutPreDeactivation())...),

Copy link
Contributor Author

@mmulholla mmulholla Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mfrancisc you were, of course, correct, I removed the change to decrement the count.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also updated condition in registration_service_test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for addressing my comment!

@mfrancisc
Copy link
Contributor

/ok-to-test

@alexeykazakov
Copy link
Contributor

/ok-to-test

@openshift-merge-robot
Copy link

@mmulholla: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e 4b11038 link true /test e2e

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@mmulholla mmulholla force-pushed the RemoveUserSignUpApprovalAfterDeactivation branch from 4b11038 to d4eba97 Compare October 4, 2023 19:40
@mmulholla mmulholla changed the title [WIP] set approved to false after user sign up deactivated set approved to false after user sign up deactivated Oct 11, 2023
@mmulholla
Copy link
Contributor Author

/retest

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
7.8% 7.8% Duplication

Copy link
Collaborator

@MatousJobanek MatousJobanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@@ -295,7 +295,7 @@ func TestVerificationRequiredMetric(t *testing.T) {
// when reactivating the user
InvokeEndpoint(t, "POST", route+"/api/v1/signup", token0, "", http.StatusAccepted)
userSignup, err = hostAwait.WaitForUserSignup(t, identity0.Username,
wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.VerificationRequired())...),
wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.VerificationRequired(), wait.ApprovedDeactivated())...),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something we should improve in the future as well. Instead of keeping the old "Deactivated' reason we could add a different one. But it's fine for now 👍

Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@openshift-ci
Copy link

openshift-ci bot commented Oct 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MatousJobanek, mfrancisc, mmulholla

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@alexeykazakov alexeykazakov merged commit 1f97c8d into codeready-toolchain:master Oct 13, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants