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

fix disable copied csv e2e test failure #2543

Merged

Conversation

akihikokuroda
Copy link
Member

Signed-off-by: akihikokuroda akihikokuroda2020@gmail.com

Description of the change:
The all tests in Describe("Disabling copied CSVs" need a namespace, operatorgroup and csv but they are setup only for the first test. These are not cleaned up after the test so the following tests success when the tests are executed from top to bottom. This PR adds the setup and clean up for all tests in "Disabling copied CSVs".

Motivation for the change:
Closes #2542
Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive

@openshift-ci
Copy link

openshift-ci bot commented Dec 27, 2021

Hi @akihikokuroda. Thanks for your PR.

I'm waiting for a operator-framework 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.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 27, 2021
@akihikokuroda
Copy link
Member Author

The unit test failure is addressed in #2522

@akihikokuroda akihikokuroda force-pushed the disablecsv branch 2 times, most recently from 28904dd to 5df4ea7 Compare January 3, 2022 18:07
test/e2e/csv_e2e_test.go Outdated Show resolved Hide resolved
@perdasilva
Copy link
Collaborator

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 3, 2022
@akihikokuroda akihikokuroda force-pushed the disablecsv branch 2 times, most recently from 9a7cdde to d05dd7f Compare January 3, 2022 20:36
Comment on lines 4210 to 4221
ns = &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: genName("csv-toggle-test-"),
},
}

if err := ctx.Ctx().Client().Create(context.TODO(), &operatorGroup); err != nil && !k8serrors.IsAlreadyExists(err) {
ctx.Ctx().Logf("Unable to create og: %v", err)
return err
}
operatorGroup = operatorsv1.OperatorGroup{
ObjectMeta: metav1.ObjectMeta{
Name: genName("csv-toggle-test-"),
Namespace: ns.GetName(),
},
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the SetupGeneratedTestNamespace helper function instead, which is a way to generate a test namespace + an OperatorGroup resource? That allows us to also use the TeardownNamespace helper function to also collect test artifacts when an individual test case fails.

For a concrete example of this pattern: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/test/e2e/subscription_e2e_test.go#L58.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I'll take a look.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had to tweak SetupGeneratedTestNamespace function a little bit for this test.

Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason you had to change around that helper function? It's not immediately clear to me when looking at these changes again, as the output of the previous and current implementation(s) all appear to have the same output:

  • A namespace is created
  • An OperatorGroup that targets the generated namespace is created

Am I missing something?

@perdasilva
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 4, 2022
@awgreene
Copy link
Member

awgreene commented Jan 5, 2022

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jan 5, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akihikokuroda, awgreene

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 5, 2022
@timflannagan
Copy link
Contributor

@akihikokuroda It looks like you need to rebase against master to make branch protection rules happy.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 5, 2022
@timflannagan
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 5, 2022
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 6, 2022
@timflannagan
Copy link
Contributor

@akihikokuroda Apologies - can you rebase this PR once more 😆 - we should prioritize this merging before any other PRs at this point.

Signed-off-by: akihikokuroda <akihikokuroda2020@gmail.com>
@timflannagan
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 6, 2022
@openshift-merge-robot openshift-merge-robot merged commit edf6e7b into operator-framework:master Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e "should have copied CSVs in all other Namespaces" failure
6 participants