Skip to content

e2e: Allow running against an existing deployment #276

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

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

mrogers950
Copy link
Contributor

@mrogers950 mrogers950 commented Jul 28, 2022

  • Add TEST_BUNDLE_INSTALL env variable that makes the e2e suite skip initialization of the cluster and operator resources for each test case. This allows running the e2e suite against an existing deployment in a single namespace (such as an OLM install) when used together with TEST_WATCH_NAMESPACE and TEST_OPERATOR_NAMESPACE.
  • Add a test case cleanup step to kill the operator pod when TEST_BUNDLE_INSTALL is used. This resets the metrics counter for subsequent tests.

Test with:

$ make catalog-deploy
$ TEST_BUNDLE_INSTALL=1 TEST_WATCH_NAMESPACE=openshift-file-integrity TEST_OPERATOR_NAMESPACE=openshift-file-integrity make e2e

ref: openshift/release#30613
fixes: #269

@openshift-ci openshift-ci bot requested review from jhrozek and Vincent056 July 28, 2022 16:42
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2022
@mrogers950 mrogers950 changed the title e2e: Allow running from an existing deployment e2e: Allow running against an existing deployment Jul 28, 2022
@rhmdnd
Copy link
Contributor

rhmdnd commented Jul 28, 2022

Test with:

$ make catalog-deploy
$ TEST_BUNDLE_INSTALL=1 TEST_WATCH_NAMESPACE=openshift-file-integrity TEST_OPERATOR_NAMESPACE=openshift-file-integrity make e2e

I think it would be good to add this to the testing documentation somewhere.

Copy link
Contributor

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

The code makes sense. Still walking through running it locally.

Do I need to do a catalog-deploy to test this change? I attempted to run make e2e against an operator installed with 0.1.24 and ended up with:

=== RUN   TestFileIntegrityLogAndReinitDatabase
    helpers.go:265: failed to initialize cluster resources: serviceaccounts "file-integrity-daemon" already exists
--- FAIL: TestFileIntegrityLogAndReinitDatabase (45.28s)

@mrogers950
Copy link
Contributor Author

The code makes sense. Still walking through running it locally.

Do I need to do a catalog-deploy to test this change? I attempted to run make e2e against an operator installed with 0.1.24 and ended up with:

=== RUN   TestFileIntegrityLogAndReinitDatabase
    helpers.go:265: failed to initialize cluster resources: serviceaccounts "file-integrity-daemon" already exists
--- FAIL: TestFileIntegrityLogAndReinitDatabase (45.28s)

Oh yeah, 0.1.24 has the old bundle with SA in it. But, this will be running in CI against future PR heads, which is .30+, so I won't worry about it.

- Add TEST_BUNDLE_INSTALL env variable that makes the e2e suite skip
  initialization of the cluster and operator resources for each test
  case. This allows running the e2e suite against an existing deployment
  in a single namespace (such as an OLM install) when used together
  with TEST_WATCH_NAMESPACE and TEST_OPERATOR_NAMESPACE.
- Add a test case cleanup step to kill the operator pod when
  TEST_BUNDLE_INSTALL is used. This resets the metrics counter for
  subsequent tests.
Running the e2e suite normally handles the operator deployment for each test case. The e2e suite can also be run against an existing deployment with the `TEST_BUNDLE_INSTALL` variable (set to `1` or `true`). The following example builds development images including the bundle and catalog, deploys them to a running cluster, and executes the e2e suite against the deployment.
```
$ export IMAGE_REPO=myrepo
$ export TAG=testing
Copy link
Contributor

Choose a reason for hiding this comment

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

These are technically optional, right? Someone could install from OperatorHub, or quay.io/file-integrity-operator, and things would still work (I installed 0.1.24 from OperatorHub and it's working).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, though in this example is that it's testing development images.

Copy link
Contributor

@rhmdnd rhmdnd 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 openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 28, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrogers950, rhmdnd

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-robot
Copy link

/retest-required

Remaining retests: 2 against base HEAD 59cc83f and 8 for PR HEAD 2a57e57 in total

@rhmdnd
Copy link
Contributor

rhmdnd commented Jul 28, 2022

/retest

Failed waiting for the environment to come up

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 28, 2022

@mrogers950: all tests passed!

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.

@openshift-merge-robot openshift-merge-robot merged commit 797bb98 into openshift:master Jul 28, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to run end-to-end tests using operator installed from catalog source
4 participants