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

e2e: Run on other architectures #799

Merged
merged 9 commits into from
Mar 14, 2022

Conversation

gquillar
Copy link
Contributor

To support other architectures, we should be able to generate the e2e test content images on other architectures and run the e2e tests using these images.
To do that, this patch gathers all the e2e test content images to CO repo quay.io/compliance-operator/test-broken-content and reference these images by tags instead of by digest.
New rules are added in the Makefile to build theses images and the existing rules are fixed to be able to run e2e tests using images from a personal repository.

With this patch, e2e test content images can be built and used to run e2e tests on ppc64le or s390x arch with the following sequence:

export IMAGE_REPO=quay.io/<personal_repo>

git clone https://github.com/ComplianceAsCode/content
cd content
podman build -f Dockerfiles/ocp4_content -t ${IMAGE_REPO}/ocp4 .
podman push ${IMAGE_REPO}/ocp4
cd ..

git clone https://github.com/openshift/compliance-operator
cd compliance-operator
make push-openscap-image
make push
make push-index
export E2E_BROKEN_CONTENT_IMAGE_PATH=$IMAGE_REPO/test-broken-content
export E2E_CONTENT_IMAGE_PATH=$IMAGE_REPO/ocp4
export E2E_USE_DEFAULT_IMAGES=true
make push-e2e-content
make e2e

@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 Feb 28, 2022
@openshift-ci
Copy link

openshift-ci bot commented Feb 28, 2022

Hi @gquillar. Thanks for your PR.

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

@jhrozek
Copy link
Contributor

jhrozek commented Mar 1, 2022

/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 Mar 1, 2022
@gquillar
Copy link
Contributor Author

gquillar commented Mar 1, 2022

/retest

@gquillar
Copy link
Contributor Author

gquillar commented Mar 2, 2022

/test e2e-aws

@jhrozek
Copy link
Contributor

jhrozek commented Mar 3, 2022

Did you run the e2e tests in your environment? Did they work OK?
Can you rebase the patches atop origin/master and push again to get rid of the merge commit? For some reason I'm having trouble checking out the PR locally..

@gquillar
Copy link
Contributor Author

gquillar commented Mar 3, 2022

@jhrozek, e2e tests worked fine in my environment. I've rebased the patches atop origin/master and pushed again.

@gquillar
Copy link
Contributor Author

gquillar commented Mar 3, 2022

I didn't understand why a lot of CI tests failed with scan timeouts although they worked fine in my environment.
I don't know if the rebase may have changed that. Let's see...

@jhrozek
Copy link
Contributor

jhrozek commented Mar 3, 2022 via email

@@ -37,8 +38,10 @@ RELATED_IMAGE_OPENSCAP_TAG?=1.3.5
# Image path to use. Set this if you want to use a specific path for building
# or your e2e tests. This is overwritten if we bulid the image and push it to
# the cluster or if we're on CI.
DEFAULT_IMAGE_OPERATOR_PATH=quay.io/compliance-operator/$(APP_NAME):latest
DEFAULT_IMAGE_OPENSCAP_PATH=quay.io/compliance-operator/$(RELATED_IMAGE_OPENSCAP_NAME):$(RELATED_IMAGE_OPENSCAP_TAG)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I see correctly that this variable definition is twice in the Makefile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not the same variable: one for operator and one for openscap

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oups I see, DEFAULT_IMAGE_OPENSCAP_PATH declaration at line 2 was an extra paste. Need to be removed

Makefile Outdated
@@ -300,24 +308,24 @@ test-benchmark: ## Run the benchmark tests -- Note that this can only be ran for
e2e: namespace tear-down operator-sdk image-to-cluster openshift-user deploy-crds ## Run the end-to-end tests
@echo "WARNING: This will temporarily modify deploy/operator.yaml"
@echo "Replacing workload references in deploy/operator.yaml"
@$(SED) 's%$(IMAGE_REPO)/$(RELATED_IMAGE_OPENSCAP_NAME):$(RELATED_IMAGE_OPENSCAP_TAG)%$(RELATED_IMAGE_OPENSCAP_PATH)%' deploy/operator.yaml
@$(SED) 's%$(IMAGE_REPO)/$(APP_NAME):latest%$(RELATED_IMAGE_OPERATOR_PATH)%' deploy/operator.yaml
@$(SED) 's%$(DEFAULT_IMAGE_OPENSCAP_PATH)%$(RELATED_IMAGE_OPENSCAP_PATH):$(RELATED_IMAGE_OPENSCAP_TAG)%' deploy/operator.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I wonder if this is the reason for failure I'm seeing..while running the e2e tests locally I see the tag twice in the scanner pods:

  Warning  InspectFailed   5s (x4 over 22s)  kubelet            Failed to apply default image tag "image-registry.openshift-image-registry.svc:5000/openshift/openscap-ocp:1.3.5:1.3.5": couldn't parse image reference "image-registry.openshift-image-registry.svc:5000/openshift/openscap-ocp:1.3.5:1.3.5": invalid reference format

I guess this might also be the reason for the CI failing. I'm sorry I didn't have enough time to dive deeper into why this is failing..

@gquillar
Copy link
Contributor Author

gquillar commented Mar 4, 2022

One test failed:
--- FAIL: TestE2E/Parallel_tests/TestSuiteWithContentThatDoesNotMatch (1185.01s)
helpers.go:263: expecting NOT-APPLICABLE got NON-COMPLIANT

@gquillar
Copy link
Contributor Author

gquillar commented Mar 4, 2022

/test e2e-aws

@Vincent056
Copy link
Contributor

Vincent056 commented Mar 5, 2022

@gquillar the e2e fail might be unrelated, I added this PR to see if it fixes the issue #803

@gquillar
Copy link
Contributor Author

gquillar commented Mar 5, 2022

@Vincent056 Thanks to point out this timeout issue. The log confirms that the 20mn timeout is reached due too many parallel tests within this delay.

@gquillar
Copy link
Contributor Author

gquillar commented Mar 8, 2022

/test e2e-aws

@jhrozek
Copy link
Contributor

jhrozek commented Mar 9, 2022

Thank you for your patience. There is only one test failing now, which is TestE2E/Parallel_tests/TestSuiteWithContentThatDoesNotMatch. We fixed that test using the old hardcoded images this week (this is why I had the delay in review as well). Can I ask you to add the following content image for the broken_os_detection image in the test? Then I think everything should be good to go.

I uploaded the file to:
https://jhrozek.fedorapeople.org/ssg-rhcos4-ds.xml

@gquillar
Copy link
Contributor Author

/test e2e-aws

@gquillar
Copy link
Contributor Author

/test e2e-aws

@jhrozek
Copy link
Contributor

jhrozek commented Mar 10, 2022

Just going to kick the e2e test, the one that failed is occasionally flaky (and it's my fault, I added it recently)
/retest

@openshift-ci
Copy link

openshift-ci bot commented Mar 10, 2022

@gquillar: 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.

@gquillar
Copy link
Contributor Author

Thanks @jhrozek, all tests are now passed. Waiting for approved, lgtm labels.

Copy link
Contributor

@jhrozek jhrozek 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 Mar 14, 2022
@openshift-ci
Copy link

openshift-ci bot commented Mar 14, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gquillar, jhrozek

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 Mar 14, 2022
@openshift-merge-robot openshift-merge-robot merged commit b536b36 into openshift:master Mar 14, 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.

4 participants