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/samples/cleanup: centralize code to integrate the project with OLM #4144

Conversation

camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Oct 29, 2020

Description of the change:

  • Move the olm helpers in the hack/generate/samples/internal/pkg/utils.go to internal/testutils/olm.go. Reason: allow samples and tests to use the same helper and keep it in a more appropriate place.
  • Remove the duplicates calls made in the e2e tests which are already done in the samples in the e2e tests
  • Use the e2e test the helper instead of duplicate the code.

Motivation for the change:

  • Maintainability
  • Reduce CI effort by not calling make bundle twice.
  • Centralize the steps to integrate the projects with OLM and keep samples and e2e tests using the same func
  • Reduce the duplication of code as of the calls made

@camilamacedo86 camilamacedo86 changed the title cleanup: centralize code to integrate the project with OLM test-e2e/samples/cleanup: centralize code to integrate the project with OLM Oct 31, 2020
Copy link
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2020
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2020
@@ -76,7 +76,9 @@ func (ma *MemcachedAnsible) Run() {
ma.addingAnsibleTask()
ma.addingMoleculeMockData()

pkg.RunOlmIntegration(ma.ctx)
log.Infof("integrate the sample with OLM")
err = ma.ctx.IntegrateProjectWithOLM()
Copy link
Member

Choose a reason for hiding this comment

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

This looks clean for all the three e2e tests ! :)

Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2020
internal/testutils/olm.go Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2020
@estroz
Copy link
Member

estroz commented Nov 5, 2020

Holding this for discussion (see #4144 (comment))

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 5, 2020
@camilamacedo86 camilamacedo86 force-pushed the centralize-olm-int-steps branch 3 times, most recently from 56316c1 to 7524fe3 Compare November 13, 2020 16:27
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 16, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 16, 2020
@camilamacedo86 camilamacedo86 force-pushed the centralize-olm-int-steps branch 6 times, most recently from e97cf66 to 96e7f65 Compare December 7, 2020 10:43
@@ -76,7 +76,13 @@ func (ma *MemcachedAnsible) Run() {
ma.addingAnsibleTask()
ma.addingMoleculeMockData()

ma.ctx.CreateBundle()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal here is to centralize the implementation to allow samples and tests to use the same. Then, the StripBundleAnnotations is only required for the samples.


err = ctx.StripBundleAnnotations()
CheckError("stripping bundle annotations", err)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note that we are moving it out to the internal/testutils/olm.go where it can be used by both.

Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

Two suggestions, otherwise LGTM

Comment on lines 33 to 34
if tc.IsRunningOnKind() {
By("loading the bundle image into Kind cluster")
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to load the bundle image since run bundle would be able to pull it itself.

Suggested change
if tc.IsRunningOnKind() {
By("loading the bundle image into Kind cluster")
if tc.IsRunningOnKind() {
By("loading the bundle image into Kind cluster")

internal/testutils/olm.go Outdated Show resolved Hide resolved
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2020
@camilamacedo86 camilamacedo86 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 16, 2020
@camilamacedo86 camilamacedo86 merged commit 6a9c7b3 into operator-framework:master Dec 16, 2020
@camilamacedo86 camilamacedo86 deleted the centralize-olm-int-steps branch December 16, 2020 18:33
reinvantveer pushed a commit to reinvantveer/operator-sdk that referenced this pull request Feb 5, 2021
…th OLM (operator-framework#4144)

**Description of the change:**
- Move the olm helpers in the `hack/generate/samples/internal/pkg/utils.go` to `internal/testutils/olm.go`. Reason: allow samples and tests to use the same helper and keep it in a more appropriate place. 
- Remove the duplicates calls made in the e2e tests which are already done in the samples in the e2e tests
- Use the e2e test the helper instead of duplicate the code. 


**Motivation for the change:**
- Maintainability
- Reduce CI effort by not calling make bundle twice. 
- Centralize the steps to integrate the projects with OLM and keep samples and e2e tests using the same func
- Reduce the duplication of code as of the calls made 


Signed-off-by: reinvantveer <[email protected]>
rearl-scwx pushed a commit to rearl-scwx/operator-sdk that referenced this pull request Feb 5, 2021
…th OLM (operator-framework#4144)

**Description of the change:**
- Move the olm helpers in the `hack/generate/samples/internal/pkg/utils.go` to `internal/testutils/olm.go`. Reason: allow samples and tests to use the same helper and keep it in a more appropriate place. 
- Remove the duplicates calls made in the e2e tests which are already done in the samples in the e2e tests
- Use the e2e test the helper instead of duplicate the code. 


**Motivation for the change:**
- Maintainability
- Reduce CI effort by not calling make bundle twice. 
- Centralize the steps to integrate the projects with OLM and keep samples and e2e tests using the same func
- Reduce the duplication of code as of the calls made 


Signed-off-by: rearl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants