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

Build e2e and integration test images as part of PR checks #3933

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

jsliacan
Copy link
Contributor

@jsliacan jsliacan commented Nov 29, 2023

Fixes: Issue #3931

Introduce a GH workflow with 2 jobs (run in parallel by default). 1 job builds e2e image and the other builds integration image. Both images are tagged with id-${{github.sha}}, archived as .tar files and uploaded as artifacts (instead of pushing to external registry). The purpose of these images is tied to the lifetime of a PR anyways.

These artifacts will be consumed by another workflow (windows-e2e/integration) which will use them to run e2e and integration PR checks on windows environment.

Note
Using ${{github.sha}} as the correlation number should work for both pull_request and push to main trigger events. For this, I have 2 github context dumps for each case (PR, push). Two workflows (test1 and test2) were triggered by the same event (PR or push to main) and context dump was saved. Comparing github.sha values suggests that they are the same for these workflows (as they should be). This generalizes the previous approach where we used PR# to correlate workflows. Moreover, the sha approach comes with another advantage. The sha changes from trigger to trigger, making sure that if we download an artifact with the correct sha, it will be the intended one and not one from a previous trigger. This would not be guaranteed when using PR# as id, because that does not change from trigger to trigger.

gha-win-e2e.pdf

@openshift-ci openshift-ci bot requested review from anjannath and cfergeau November 29, 2023 16:53
@jsliacan jsliacan force-pushed the gh-build-tests branch 4 times, most recently from 8a0e9e5 to 156b8c5 Compare November 29, 2023 17:50
@jsliacan jsliacan changed the title Build e2e and integration test images as part of PR checks [WIP] Build e2e and integration test images as part of PR checks Nov 29, 2023
@cfergeau
Copy link
Contributor

cfergeau commented Dec 1, 2023

Good to have CI for these container images as sometimes we use wrong base images in these, which cause build failures we only notice fairly late.

- name: Check out repository code
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
Copy link
Contributor

Choose a reason for hiding this comment

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

why are you login?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I missed it when changing the flow. Mistake, removed. Thanks!

@anjannath anjannath changed the title [WIP] Build e2e and integration test images as part of PR checks Build e2e and integration test images as part of PR checks Dec 5, 2023
- name: Upload e2e artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.IMAGE_NAME_E2E }}-pr${{ github.event.number }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why some steps use the ${{ github.event.number }} directly and others use then env section?

env:
PR_NUMBER: ${{ github.event.number }}
run: |
podman save -o ${{ env.IMAGE_NAME_E2E }}.tar quay.io/crcont/${{ env.IMAGE_NAME_E2E}}:pr-${PR_NUMBER}
Copy link
Contributor

Choose a reason for hiding this comment

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

Also may build and save can be added together on a single step? it will make things a bit easier to read IMHO

run: |
podman save -o ${{ env.IMAGE_NAME_E2E }}.tar quay.io/crcont/${{ env.IMAGE_NAME_E2E}}:pr-${PR_NUMBER}

- name: Upload e2e artifact
Copy link
Contributor

Choose a reason for hiding this comment

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

Would change to Upload e2e image (to match previous naming convention for steps)

@jsliacan jsliacan force-pushed the gh-build-tests branch 3 times, most recently from f6b5530 to a245fb2 Compare December 8, 2023 12:05
Copy link

openshift-ci bot commented Dec 8, 2023

@jsliacan: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-crc 83df475 link true /test e2e-crc
ci/prow/integration-crc 83df475 link true /test integration-crc
ci/prow/e2e-microshift-crc 83df475 link true /test e2e-microshift-crc

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.

Copy link

openshift-ci bot commented Dec 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianriobo

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants