|
39 | 39 | strategy:
|
40 | 40 | fail-fast: false
|
41 | 41 | matrix:
|
42 |
| - parallel-id: [0, 1, 2, 3] |
| 42 | + parallel-id: [ 0, 1, 2, 3 ] |
43 | 43 | runs-on: ubuntu-latest
|
44 | 44 | env:
|
45 | 45 | # absolute path to test artifacts directory
|
@@ -114,16 +114,15 @@ jobs:
|
114 | 114 | runs-on: ubuntu-latest
|
115 | 115 | needs: e2e
|
116 | 116 | steps:
|
117 |
| - - run: | |
118 |
| - echo "Matrix result: ${{ needs.e2e.result }}" |
119 |
| - - name: check individual matrix results |
120 |
| - if: ${{ needs.e2e.result == 'failure' }} |
121 |
| - run: | |
122 |
| - echo 'Failure: at least one e2e matrix job has failed' |
123 |
| - exit 1 |
| 117 | + - run: | |
| 118 | + echo "Matrix result: ${{ needs.e2e.result }}" |
| 119 | + - name: check individual matrix results |
| 120 | + if: ${{ needs.e2e.result == 'failure' }} |
| 121 | + run: | |
| 122 | + echo 'Failure: at least one e2e matrix job has failed' |
| 123 | + exit 1 |
| 124 | +
|
124 | 125 |
|
125 |
| - # Run e2e tests in parallel jobs |
126 |
| - # Take olm image from the previous stage |
127 | 126 | e2e-flakes:
|
128 | 127 | needs: build
|
129 | 128 | strategy:
|
@@ -191,3 +190,71 @@ jobs:
|
191 | 190 | name: e2e-test-output-${{ (github.event.pull_request.head.sha || github.sha) }}-${{ github.run_id }}-flakes
|
192 | 191 | path: ${{ env.ARTIFACT_DIR }}/*
|
193 | 192 | # TODO: create job to combine test artifacts using code in https://github.com/operator-framework/operator-lifecycle-manager/pull/1476
|
| 193 | + |
| 194 | + e2e-failforward: |
| 195 | + needs: build |
| 196 | + strategy: |
| 197 | + fail-fast: false |
| 198 | + runs-on: ubuntu-latest |
| 199 | + env: |
| 200 | + # absolute path to test artifacts directory |
| 201 | + ARTIFACT_DIR: ${{ github.workspace }}/artifacts |
| 202 | + E2E_NODES: 1 |
| 203 | + E2E_KUBECONFIG_ROOT: ${{ github.workspace }}/kubeconfigs |
| 204 | + steps: |
| 205 | + # checkout code and setup go |
| 206 | + - uses: actions/checkout@v4 |
| 207 | + - uses: actions/setup-go@v5 |
| 208 | + with: |
| 209 | + go-version-file: "go.mod" |
| 210 | + |
| 211 | + # load the olm image |
| 212 | + - name: Load OLM Docker image |
| 213 | + uses: actions/download-artifact@v4 |
| 214 | + with: |
| 215 | + name: olm-image.tar |
| 216 | + path: . |
| 217 | + - run: docker load < olm-image.tar |
| 218 | + |
| 219 | + # set e2e environment variables |
| 220 | + # Set ginkgo output and parallelism |
| 221 | + - run: echo "GINKGO_OPTS=-output-dir ${ARTIFACT_DIR} -junit-report junit_e2e.xml -nodes ${E2E_NODES}" >> $GITHUB_ENV |
| 222 | + |
| 223 | + # Setting -kubeconfig-root tells the e2e test suite to look for kubeconfigs |
| 224 | + # in <kubeconfig-root>/kubeconfig-<node-number> |
| 225 | + # This is used to run tests in parallel on multiple clusters as the current e2e |
| 226 | + # test suite does not support running tests in parallel on a single cluster |
| 227 | + - run: echo "E2E_OPTS=-kubeconfig-root=${E2E_KUBECONFIG_ROOT}" >> $GITHUB_ENV |
| 228 | + |
| 229 | + # run e2e tests |
| 230 | + # create artifacts directory |
| 231 | + - run: mkdir -p ${ARTIFACT_DIR} |
| 232 | + |
| 233 | + # deploy test clusters |
| 234 | + - name: Deploy test cluster(s) |
| 235 | + # create kubeconfig root and store the kubeconfig for each cluster within it as you create the clusters |
| 236 | + # Add kind and helm options to specify kubeconfig location |
| 237 | + # Deploy the new cluster and helm install olm for testing |
| 238 | + run: | |
| 239 | + mkdir -p ${E2E_KUBECONFIG_ROOT} |
| 240 | + for i in $(seq 1 ${E2E_NODES}); do |
| 241 | + KIND_CLUSTER_NAME="kind-olmv0-${i}" \ |
| 242 | + KIND_CREATE_OPTS="--kubeconfig=${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \ |
| 243 | + HELM_INSTALL_OPTS="--kubeconfig ${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \ |
| 244 | + make kind-create deploy; |
| 245 | + done |
| 246 | +
|
| 247 | + # run e2e tests for flakes if matrix-id is 'flakes' |
| 248 | + - name: Run flaky e2e tests |
| 249 | + # focus on tests marked as FLAKE |
| 250 | + run: | |
| 251 | + GINKGO_OPTS="${GINKGO_OPTS} -label-filter 'FailForward'" make e2e |
| 252 | +
|
| 253 | + # archive test results |
| 254 | + - name: Archive Test Artifacts |
| 255 | + if: ${{ always() }} |
| 256 | + uses: actions/upload-artifact@v4 |
| 257 | + with: |
| 258 | + name: e2e-test-output-${{ (github.event.pull_request.head.sha || github.sha) }}-${{ github.run_id }}-flakes |
| 259 | + path: ${{ env.ARTIFACT_DIR }}/* |
| 260 | + # TODO: create job to combine test artifacts using code in https://github.com/operator-framework/operator-lifecycle-manager/pull/1476 |
0 commit comments