Skip to content

Commit a98b610

Browse files
authored
Merge pull request #1709 from fluxcd/backport-ci
[release/v1.9.x] ci: parallelize e2e job to speed it up
2 parents 29e8364 + 579657f commit a98b610

1 file changed

Lines changed: 64 additions & 49 deletions

File tree

.github/workflows/e2e.yaml

Lines changed: 64 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ on:
66
- 'main'
77
- 'release/**'
88
jobs:
9-
kind:
9+
test:
1010
runs-on: ubuntu-latest
1111
permissions:
12-
contents: read # for reading the repository code.
12+
contents: read
1313
steps:
14-
- name: Test suite setup
15-
uses: fluxcd/gha-workflows/.github/actions/setup-kubernetes@v0.11.0
14+
- name: Checkout
15+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
16+
- name: Setup Go
17+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
1618
with:
1719
go-version: 1.26.x
20+
cache-dependency-path: |
21+
**/go.sum
22+
**/go.mod
1823
- name: Enable integration tests
1924
# Only run integration tests for main branch
2025
if: github.ref == 'refs/heads/main'
@@ -31,6 +36,15 @@ jobs:
3136
run: make test
3237
- name: Check if working tree is dirty
3338
run: make verify
39+
kind:
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: read # for reading the repository code.
43+
steps:
44+
- name: Test suite setup
45+
uses: fluxcd/gha-workflows/.github/actions/setup-kubernetes@v0.11.0
46+
with:
47+
go-version: 1.26.x
3448
- name: Build container image
3549
run: |
3650
make docker-build IMG=test/kustomize-controller:latest \
@@ -55,49 +69,50 @@ jobs:
5569
make dev-deploy IMG=test/kustomize-controller:latest
5670
kubectl -n kustomize-system rollout status deploy/source-controller --timeout=1m
5771
kubectl -n kustomize-system rollout status deploy/kustomize-controller --timeout=1m
58-
- name: Run tests for removing kubectl managed fields
59-
run: |
60-
kubectl create ns managed-fields
61-
kustomize build github.com/stefanprodan/podinfo//kustomize?ref=6.3.5 > /tmp/podinfo.yaml
62-
kubectl -n managed-fields apply -f /tmp/podinfo.yaml
63-
kubectl -n managed-fields apply -f ./config/testdata/managed-fields
64-
kubectl -n managed-fields wait kustomization/podinfo --for=condition=ready --timeout=4m
65-
OUTDATA=$(kubectl -n managed-fields get deploy podinfo --show-managed-fields -oyaml)
66-
if echo "$OUTDATA" | grep -q "kubectl";then
67-
echo "kubectl client-side manager not removed"
68-
exit 1
69-
fi
70-
kubectl -n managed-fields apply --server-side --force-conflicts -f /tmp/podinfo.yaml
71-
kubectl -n managed-fields annotate --overwrite kustomization/podinfo reconcile.fluxcd.io/requestedAt="$(date +%s)"
72-
kubectl -n managed-fields wait kustomization/podinfo --for=condition=ready --timeout=4m
73-
OUTDATA=$(kubectl -n managed-fields get deploy podinfo --show-managed-fields -oyaml)
74-
if echo "$OUTDATA" | grep -q "kubectl";then
75-
echo "kubectl server-side manager not removed"
76-
exit 1
77-
fi
78-
kubectl delete ns managed-fields
79-
- name: Run overlays tests
80-
run: |
81-
kubectl -n kustomize-system apply -k ./config/testdata/overlays
82-
kubectl -n kustomize-system wait kustomizations/webapp-staging --for=condition=ready --timeout=4m
83-
kubectl -n kustomize-system wait kustomizations/webapp-production --for=condition=ready --timeout=4m
84-
- name: Run dependencies tests
85-
run: |
86-
kubectl -n kustomize-system apply -k ./config/testdata/dependencies
87-
kubectl -n kustomize-system wait kustomizations/common --for=condition=ready --timeout=4m
88-
kubectl -n kustomize-system wait kustomizations/backend --for=condition=ready --timeout=4m
89-
kubectl -n kustomize-system wait kustomizations/frontend --for=condition=ready --timeout=4m
90-
- name: Run impersonation tests
91-
run: |
92-
kubectl -n impersonation apply -f ./config/testdata/impersonation
93-
kubectl -n impersonation wait kustomizations/podinfo --for=condition=ready --timeout=4m
94-
kubectl -n impersonation delete kustomizations/podinfo
95-
until kubectl -n impersonation get deploy/podinfo 2>&1 | grep NotFound ; do sleep 2; done
96-
- name: Run OCI tests
97-
run: |
98-
kubectl create ns oci
99-
kubectl -n oci apply -f ./config/testdata/oci
100-
kubectl -n oci wait kustomizations/oci --for=condition=ready --timeout=4m
72+
- parallel:
73+
- name: Run managed-fields tests
74+
run: |
75+
kubectl create ns managed-fields
76+
kustomize build github.com/stefanprodan/podinfo//kustomize?ref=6.3.5 > /tmp/podinfo.yaml
77+
kubectl -n managed-fields apply -f /tmp/podinfo.yaml
78+
kubectl -n managed-fields apply -f ./config/testdata/managed-fields
79+
kubectl -n managed-fields wait kustomization/podinfo --for=condition=ready --timeout=4m
80+
OUTDATA=$(kubectl -n managed-fields get deploy podinfo --show-managed-fields -oyaml)
81+
if echo "$OUTDATA" | grep -q "kubectl";then
82+
echo "kubectl client-side manager not removed"
83+
exit 1
84+
fi
85+
kubectl -n managed-fields apply --server-side --force-conflicts -f /tmp/podinfo.yaml
86+
kubectl -n managed-fields annotate --overwrite kustomization/podinfo reconcile.fluxcd.io/requestedAt="$(date +%s)"
87+
kubectl -n managed-fields wait kustomization/podinfo --for=condition=ready --timeout=4m
88+
OUTDATA=$(kubectl -n managed-fields get deploy podinfo --show-managed-fields -oyaml)
89+
if echo "$OUTDATA" | grep -q "kubectl";then
90+
echo "kubectl server-side manager not removed"
91+
exit 1
92+
fi
93+
kubectl delete ns managed-fields
94+
- name: Run overlays and dependencies tests
95+
run: |
96+
echo ">>> Run overlays tests"
97+
kubectl -n kustomize-system apply -k ./config/testdata/overlays
98+
kubectl -n kustomize-system wait kustomizations/webapp-staging --for=condition=ready --timeout=4m
99+
kubectl -n kustomize-system wait kustomizations/webapp-production --for=condition=ready --timeout=4m
100+
echo ">>> Run dependencies tests"
101+
kubectl -n kustomize-system apply -k ./config/testdata/dependencies
102+
kubectl -n kustomize-system wait kustomizations/common --for=condition=ready --timeout=4m
103+
kubectl -n kustomize-system wait kustomizations/backend --for=condition=ready --timeout=4m
104+
kubectl -n kustomize-system wait kustomizations/frontend --for=condition=ready --timeout=4m
105+
- name: Run impersonation and OCI tests
106+
run: |
107+
echo ">>> Run impersonation tests"
108+
kubectl -n impersonation apply -f ./config/testdata/impersonation
109+
kubectl -n impersonation wait kustomizations/podinfo --for=condition=ready --timeout=4m
110+
kubectl -n impersonation delete kustomizations/podinfo
111+
until kubectl -n impersonation get deploy/podinfo 2>&1 | grep NotFound ; do sleep 2; done
112+
echo ">>> Run OCI tests"
113+
kubectl create ns oci
114+
kubectl -n oci apply -f ./config/testdata/oci
115+
kubectl -n oci wait kustomizations/oci --for=condition=ready --timeout=4m
101116
- name: Logs
102117
if: always()
103118
continue-on-error: true
@@ -110,8 +125,8 @@ jobs:
110125
kubectl -n kustomize-system get gitrepositories -oyaml
111126
kubectl -n kustomize-system get kustomizations -oyaml
112127
kubectl -n kustomize-system get all
113-
kubectl -n oci get ocirepository/oci -oyaml
114-
kubectl -n oci get kustomization/oci -oyaml
128+
kubectl -n oci get ocirepository/oci -oyaml || true
129+
kubectl -n oci get kustomization/oci -oyaml || true
115130
sops-openbao:
116131
runs-on: ubuntu-latest
117132
permissions:

0 commit comments

Comments
 (0)