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

test/e2e: Fix 'resource name may not be empty' failure in catalog templating test case #2457

Conversation

timflannagan
Copy link
Member

Description of the change:
Update the 'adding catalog template adjusts image used' test case and
fix the issue where get requests for the test catalogsource were failing
due to the source.GetName() and source.GetNamespace() being empty, and
therefore the test catalogsource could never be updated.

Updating the test logic to avoid overwriting the source variable
during every poll by suppressing the variable returned appeared to be
the culprit. This was consistently reproducible on a cluster when
focusing on this single test and running the e2e suite directly.
After making these changes, I wasn't able to reproduce locally anymore.

Motivation for the change:
Reducing e2e flakes overtime.

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

…plating test case

Update the 'adding catalog template adjusts image used' test case and
fix the issue where get requests for the test catalogsource were failing
due to the source.GetName() and source.GetNamespace() being empty, and
therefore the test catalogsource could never be updated.

Updating the test logic to avoid overwriting the `source` variable
during every poll by suppressing the variable returned appeared to be
the culprit. This was consistently reproducible on a cluster when
focusing on this single test and running the e2e suite directly.
After making these changes, I wasn't able to reproduce locally anymore.

Signed-off-by: timflannagan <[email protected]>
@openshift-ci openshift-ci bot requested review from exdx and joelanford November 17, 2021 21:34
@timflannagan timflannagan force-pushed the test/fix-resource-name-may-not-empty branch from 14332e6 to c420158 Compare November 17, 2021 21:34
@timflannagan
Copy link
Member Author

I'd recommend reviewing by the commits vs. the full diff as I sneaked in another commit to replace context.TODO -> context.Background commit too.

@timflannagan
Copy link
Member Author

More context here as well: #2397 (comment)

@kevinrizza
Copy link
Member

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 18, 2021
Copy link
Member

@njhale njhale left a comment

Choose a reason for hiding this comment

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

/approve

@@ -1099,7 +1105,7 @@ var _ = Describe("Catalog represents a store of bundles which OLM can use to ins
}

return false, nil
}, 5*time.Minute, 1*time.Second).Should(BeTrue())
}).Should(BeTrue())

// source should be the latest we got from the eventually block
Expect(source.Status.Conditions).ToNot(BeNil())
Copy link
Member

Choose a reason for hiding this comment

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

nit: I suspect we could refactor most of the rest of this test into a matcher for the previous Eventually statement.

Comment on lines +1086 to +1088
source.SetAnnotations(map[string]string{
catalogsource.CatalogImageTemplateAnnotation: fmt.Sprintf("quay.io/olmtest/catsrc-update-test:%s.%s.%s", catalogsource.TemplKubeMajorV, catalogsource.TemplKubeMinorV, catalogsource.TemplKubePatchV),
})
Copy link
Member

Choose a reason for hiding this comment

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

nit: we could define the map literal outside of this closure and set it here too

@openshift-ci
Copy link

openshift-ci bot commented Nov 18, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kevinrizza, njhale, timflannagan

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

@njhale
Copy link
Member

njhale commented Nov 18, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 18, 2021
@openshift-merge-robot openshift-merge-robot merged commit f254e91 into operator-framework:master Nov 18, 2021
@timflannagan timflannagan deleted the test/fix-resource-name-may-not-empty branch November 18, 2021 16:02
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants