Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 410a57a

Browse files
author
Per Goncalves da Silva
committedApr 29, 2025·
seeing if isolating FF tests improves success rate
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent 0a6499f commit 410a57a

File tree

2 files changed

+81
-10
lines changed

2 files changed

+81
-10
lines changed
 

‎.github/workflows/e2e-tests.yml

Lines changed: 77 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
parallel-id: [0, 1, 2, 3]
42+
parallel-id: [ 0, 1, 2, 3 ]
4343
runs-on: ubuntu-latest
4444
env:
4545
# absolute path to test artifacts directory
@@ -114,16 +114,15 @@ jobs:
114114
runs-on: ubuntu-latest
115115
needs: e2e
116116
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+
124125
125-
# Run e2e tests in parallel jobs
126-
# Take olm image from the previous stage
127126
e2e-flakes:
128127
needs: build
129128
strategy:
@@ -191,3 +190,71 @@ jobs:
191190
name: e2e-test-output-${{ (github.event.pull_request.head.sha || github.sha) }}-${{ github.run_id }}-flakes
192191
path: ${{ env.ARTIFACT_DIR }}/*
193192
# 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

‎test/e2e/split/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"math"
1212
"os"
1313
"path/filepath"
14+
"slices"
1415
"sort"
1516
"strings"
1617

@@ -87,6 +88,9 @@ func (opts options) run(dir string) error {
8788
if err != nil {
8889
return err
8990
}
91+
labels = slices.DeleteFunc(labels, func(s string) bool {
92+
return s == "FailForward"
93+
})
9094
sort.Strings(labels)
9195

9296
var out string

0 commit comments

Comments
 (0)
Please sign in to comment.