QE OCP 4.19 Intrusive Testing #183
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: QE OCP 4.19 Intrusive Testing | |
| on: | |
| # pull_request: | |
| # branches: [ main ] | |
| workflow_dispatch: | |
| # Schedule a daily cron at midnight UTC | |
| schedule: | |
| - cron: '0 0 * * *' | |
| permissions: | |
| contents: read | |
| env: | |
| QE_REPO: redhat-best-practices-for-k8s/certsuite-qe | |
| ENABLE_CERTSUITE_MEMORY_LIMIT: true | |
| jobs: | |
| build-and-store: | |
| if: github.repository_owner == 'redhat-best-practices-for-k8s' | |
| # build and store the image | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6.0.1 | |
| with: | |
| ref: ${{ github.sha }} | |
| - name: Free Disk Space | |
| uses: ./.github/actions/free-disk-space | |
| continue-on-error: true | |
| - name: Setup docker buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 | |
| - name: Build temporary image tag for this PR | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| tags: quay.io/redhat-best-practices-for-k8s/certsuite:localtest | |
| outputs: type=docker,dest=/tmp/testimage.tar | |
| - name: Build the binary | |
| run: make build-certsuite-tool | |
| - name: Store image as artifact | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: testimage | |
| path: /tmp/testimage.tar | |
| - name: Store binary as artifact | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: certsuite-binary | |
| path: ./certsuite | |
| qe-ocp-419-intrusive-testing: | |
| name: QE OCP 4.19 Tests (${{ matrix.suite }} - ${{ matrix.run-type }}) | |
| runs-on: ubuntu-24.04 | |
| needs: build-and-store | |
| if: needs.build-and-store.result == 'success' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Add more suites if more intrusive tests are added to the QE repo | |
| suite: [lifecycle] | |
| # run-type: [binary, image] | |
| run-type: [binary] | |
| env: | |
| SHELL: /bin/bash | |
| KUBECONFIG: '/home/runner/.crc/machines/crc/kubeconfig' | |
| PFLT_DOCKERCONFIG: '/home/runner/.docker/config' | |
| DOCKER_CONFIG_DIR: '/home/runner/.docker/' | |
| TEST_CERTSUITE_IMAGE_NAME: quay.io/redhat-best-practices-for-k8s/certsuite | |
| TEST_CERTSUITE_IMAGE_TAG: localtest | |
| steps: | |
| - name: Write temporary docker file | |
| run: | | |
| mkdir -p /home/runner/.docker | |
| touch ${PFLT_DOCKERCONFIG} | |
| echo '{ "auths": {} }' >> ${PFLT_DOCKERCONFIG} | |
| if: runner.os == 'Linux' | |
| - name: Disable default go problem matcher | |
| run: echo "::remove-matcher owner=go::" | |
| - name: Check out code | |
| uses: actions/checkout@v6.0.1 | |
| with: | |
| ref: ${{ github.sha }} | |
| - name: check if CRC_PULL_SECRET exists, if not, exit | |
| env: | |
| super_secret: ${{ secrets.CRC_PULL_SECRET }} | |
| if: ${{ env.super_secret == '' }} | |
| run: | | |
| echo "CRC_PULL_SECRET is not set" | |
| exit 1 | |
| - name: Deploy the OCP Cluster | |
| uses: palmsoftware/quick-ocp@v0.0.23 | |
| with: | |
| ocpPullSecret: $OCP_PULL_SECRET | |
| bundleCache: true | |
| desiredOCPVersion: 4.19 | |
| waitForOperatorsReady: true | |
| env: | |
| OCP_PULL_SECRET: ${{ secrets.CRC_PULL_SECRET }} | |
| - name: Clone the QE repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| repository: ${{ env.QE_REPO }} | |
| path: certsuite-qe | |
| ref: main | |
| - name: Download image from artifact | |
| if: matrix.run-type == 'image' | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: testimage | |
| path: /tmp | |
| - name: Download binary from artifact | |
| if: matrix.run-type == 'binary' | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: certsuite-binary | |
| path: . | |
| - name: Make binary executable | |
| if: matrix.run-type == 'binary' | |
| run: chmod +x ./certsuite | |
| - name: Load image into docker | |
| if: matrix.run-type == 'image' | |
| run: docker load --input /tmp/testimage.tar | |
| - name: Run the tests (against image) | |
| if: matrix.run-type == 'image' | |
| uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 | |
| with: | |
| timeout_minutes: 150 | |
| max_attempts: 3 | |
| command: cd ${GITHUB_WORKSPACE}/certsuite-qe; FEATURES=${{matrix.suite}} CERTSUITE_REPO_PATH=${GITHUB_WORKSPACE} CERTSUITE_IMAGE=${{env.TEST_CERTSUITE_IMAGE_NAME}} CERTSUITE_IMAGE_TAG=${{env.TEST_CERTSUITE_IMAGE_TAG}} JOB_ID=${{github.run_id}} DISABLE_INTRUSIVE_TESTS=false ENABLE_PARALLEL=false ENABLE_FLAKY_RETRY=true make test-features | |
| - name: Run the tests (against binary) | |
| if: matrix.run-type == 'binary' | |
| uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 | |
| with: | |
| timeout_minutes: 150 | |
| max_attempts: 3 | |
| command: cd ${GITHUB_WORKSPACE}/certsuite-qe; FEATURES=${{matrix.suite}} CERTSUITE_REPO_PATH=${GITHUB_WORKSPACE} USE_BINARY=true JOB_ID=${{github.run_id}} DISABLE_INTRUSIVE_TESTS=false ENABLE_PARALLEL=false ENABLE_FLAKY_RETRY=true make test-features | |
| - name: (if on main and upstream) Send chat msg to dev team if failed to run QE tests | |
| if: ${{ failure() && github.ref == 'refs/heads/main' && github.repository_owner == 'redhat-best-practices-for-k8s' }} | |
| env: | |
| COMMIT_SHA: ${{ github.sha }} | |
| JOB_RUN_ID: ${{ github.run_id }} | |
| JOB_RUN_ATTEMPT: ${{ github.run_attempt }} | |
| GITHUB_REPO: https://github.com/redhat-best-practices-for-k8s/certsuite | |
| run: | | |
| curl -X POST --data "{ | |
| \"text\": \"🚨⚠️ Failed to run intrusive OCP 4.19 QE tests from commit \<$GITHUB_REPO/commit/$COMMIT_SHA|$COMMIT_SHA\>, job ID \<$GITHUB_REPO/actions/runs/$JOB_RUN_ID/attempts/$JOB_RUN_ATTEMPT|$JOB_RUN_ID\> \" | |
| }" -H 'Content-type: application/json; charset=UTF-8' '${{ secrets.QE_NIGHTLY_WEBHOOK }}' |