Skip to content

Commit 81bebac

Browse files
committed
chore: integrate dual kind clusters with CI
Signed-off-by: Nathan Klick <[email protected]>
1 parent 36e3a08 commit 81bebac

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

.github/workflows/flow-pull-request-checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
- { name: "Node Delete - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-coverage-report }}", cluster-name: "${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}-${{ github.run_id }}-${{ github.run_attempt }}" }
9292
- { name: "Node Add - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-add-separate-commands-coverage-report }}", cluster-name: "${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}-${{ github.run_id }}-${{ github.run_attempt }}" }
9393
- { name: "Node Upgrade - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-coverage-report }}", cluster-name: "${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}-${{ github.run_id }}-${{ github.run_attempt }}" }
94-
max-parallel: 3
94+
max-parallel: 5
9595
with:
9696
custom-job-label: ${{ matrix.e2e-test-type.name }}
9797
npm-test-script: ${{ matrix.e2e-test-type.npm-test-script }}

.github/workflows/zxc-e2e-test.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ permissions:
6969

7070
env:
7171
#CG_EXEC: export R_UID=$(id -u); CGROUP_LOGLEVEL=DEBUG cgexec -g cpu,memory:user.slice/user-${R_UID}.slice/user@${R_UID}.service/e2e-${{ github.run_id }} --sticky ionice -c 2 -n 2 nice -n 19
72-
CG_EXEC: ""
72+
CG_EXEC: "ionice -c 2 -n 2 nice -n 19"
7373

7474
jobs:
7575
e2e-test:
@@ -182,13 +182,17 @@ jobs:
182182
run: |
183183
npm link
184184
echo "SOLO_TEST_CLUSTER=${{ inputs.cluster-name }}"
185-
${{ env.CG_EXEC }} SOLO_TEST_CLUSTER=${{ inputs.cluster-name }} ./test/e2e/setup-e2e.sh
185+
${{ env.CG_EXEC }} SOLO_TEST_CLUSTER=${{ inputs.cluster-name }} ./test/e2e/dual-cluster/setup-dual-e2e.sh
186186
187187
- name: Run E2E Tests
188188
run: |
189189
echo "SOLO_TEST_CLUSTER=${{ inputs.cluster-name }}"
190190
${{ env.CG_EXEC }} SOLO_TEST_CLUSTER=${{ inputs.cluster-name }} npm run ${{ inputs.npm-test-script }}
191191
192+
- name: Sleep on Failure
193+
if: ${{ failure() }}
194+
run: sleep 3600
195+
192196
- name: Upload E2E Logs to GitHub
193197
if: ${{ !cancelled() }}
194198
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0

test/e2e/dual-cluster/setup-dual-e2e.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ for i in {1..2}; do
2121
kind delete cluster -n "${SOLO_CLUSTER_NAME}-c${i}" || true
2222
done
2323

24-
docker network rm kind
24+
docker network rm -f kind || true
2525
docker network create kind --scope local --subnet 172.19.0.0/16 --driver bridge
2626

2727
# Setup Helm Repos
@@ -40,7 +40,10 @@ for i in {1..2}; do
4040

4141
kubectl apply -f "${SCRIPT_PATH}/metallb-cluster-${i}.yaml"
4242

43-
"${CLUSTER_DIAGNOSTICS_PATH}"/deploy.sh
43+
# Deploy the diagnostics container if not running in CI
44+
if [[ -z "${CI}" ]]; then
45+
"${CLUSTER_DIAGNOSTICS_PATH}"/deploy.sh
46+
fi
4447
done
4548

4649
# **********************************************************************************************************************
@@ -52,9 +55,15 @@ done
5255
# Init and deploy a network for e2e tests in (test/e2e/core)
5356
# -d ${SOLO_CHARTS_DIR} is optional, if you want to use a local chart, it will be ignored if not set
5457
# **********************************************************************************************************************
55-
# SOLO_CLUSTER_SETUP_NAMESPACE=solo-setup
56-
# npm run build
57-
#npm run solo -- init || exit 1 # cache args for subsequent commands
58-
#npm run solo -- cluster setup -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" || exit 1
59-
#helm list --all-namespaces
60-
#sleep 10 # give time for solo-setup to finish deploying
58+
SOLO_CLUSTER_SETUP_NAMESPACE=solo-setup
59+
npm run build
60+
npm run solo -- init || exit 1 # cache args for subsequent commands
61+
62+
for i in {1..2}; do
63+
kubectl config use-context "kind-${SOLO_CLUSTER_NAME}-c${i}"
64+
npm run solo -- cluster setup -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" || exit 1
65+
helm list --all-namespaces
66+
done
67+
68+
kubectl config use-context "kind-${SOLO_CLUSTER_NAME}-c1"
69+
sleep 10 # give time for solo-setup to finish deploying

0 commit comments

Comments
 (0)