-
Notifications
You must be signed in to change notification settings - Fork 24
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
Customizable e2e tests #93
base: main
Are you sure you want to change the base?
Conversation
@@ -518,6 +518,25 @@ const rolesForBaseOperator = ` | |||
- watch | |||
#+kubebuilder:scaffold:rules | |||
` | |||
const rolesForProject = ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an upstream project, and we wouldn't put anything OCP specific here. If that is needed, it should go in the downstream fork.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually already added in the memcached-molecule-operator roles. When we tried to run it on an OCP cluster it failed as the required permissions were not available.
ansible-operator-plugins/testdata/memcached-molecule-operator/roles/memcached/tasks/main.yml
Lines 202 to 209 in 42b5d80
- name: create project if projects are available | |
kubernetes.core.k8s: | |
definition: | |
apiVersion: project.openshift.io/v1 | |
kind: Project | |
metadata: | |
name: testing-foo | |
when: "'project.openshift.io' in api_groups" |
It seems like all of these changes are OCP specific, they should probably go in the downstream project. |
I mentioned in the description that the changes are added for running the e2e test on an OCP cluster. However, the changes are actually platform agnostic and nothing is added which is specific for OCP. As the changes are platform agnostic we thought of adding them upstream. The actual OCP specific changes we'll add downstream. PLMK if you still feel that there are changes which are specific for OCP. |
f59aaf6
to
51c7732
Compare
test/e2e/ansible/cluster_test.go
Outdated
Expect(operator.UndeployOperator(ansibleSample)).To(Succeed()) | ||
testutils.WrapWarnOutput("", operator.UndeployOperator(ansibleSample)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverting this change in favour of #106
51c7732
to
9ec4420
Compare
9ec4420
to
fca322e
Compare
Signed-off-by: arkadeepsen <[email protected]>
Signed-off-by: arkadeepsen <[email protected]>
Signed-off-by: arkadeepsen <[email protected]>
fca322e
to
af30e12
Compare
PR needs rebase. 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-sigs/prow repository. |
Description of the change:
This PR adds the support of customizing the e2e tests by providing various inputs via environment variables. The behavior of the tests remains the same with the default values.
Following are the details of the changes:
project.openshift.io
. Added them so that when the e2e test for memcached-molecule-operator is run on an OCP cluster the test passes successfully.SKIP_SECRET_GENERATION
, is used to skip the generation of secret related testdata for memcached-molecule-operator. This variable can be used to generate the testdata when running the e2e test with memcached-molecule-operator on an OCP cluster. If not not skipped, the controller tries to reconcile all secrets from all namespaces which results in heavy load on the controller and the e2e test fails.MEMCACHED_MOLECULE_OPERATOR_IMAGE
environment variable is introduced which will hold the container image registry path for memcached-molecule-operator, if set. Local image will not be built when this variable is set.SKIP_LOCAL_TEST
environment variable is introduced to skip the local test when it is set.ADVANCED_MOLECULE_OPERATOR_IMAGE
environment variable is introduced which will hold the container image registry path for advanced-molecule-operator, if set. Local image will not be built when this variable is set. In addition to that, the Kind test for memcached-molecule-operator will be skipped.Motivation for the change:
The e2e tests for ansible-operator-plugins are tightly coupled with Kind cluster. We want to use the same test cases that are used in the e2e tests on an OCP cluster. To enable us to do so, the e2e tests are needed to be made customizable so that they work on an OCP cluster, in addition to a Kind cluster.