From 805c14ae821fe823422c19f4cb9bd0f94f78b471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Krienb=C3=BChl?= Date: Mon, 2 Jun 2025 16:36:16 +0200 Subject: [PATCH 1/3] Cleanup leftovers when running CI --- .github/workflows/integration-tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 634ad85..e17dc43 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -175,6 +175,10 @@ jobs: - name: Stagger tests run: 'sleep $((RANDOM % 60 + 1))' + - name: Cleanup Leftovers + if: always() + run: helpers/cleanup + - name: Create Test Cluster run: helpers/run-in-test-cluster From 8df753a8f61a3e94a9969b3560a33af51e0acd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Krienb=C3=BChl?= Date: Mon, 2 Jun 2025 16:50:27 +0200 Subject: [PATCH 2/3] Limit paralleism for integration tests --- .github/workflows/integration-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index e17dc43..9b68528 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -131,6 +131,7 @@ jobs: strategy: fail-fast: false + max-parallel: 1 matrix: include: "${{ fromJson(needs.test-matrix.outputs.tests) }}" From 58b9bfac55bc5b2c0e4a0da00dbc81b549108bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Krienb=C3=BChl?= Date: Tue, 3 Jun 2025 08:21:00 +0200 Subject: [PATCH 3/3] Ensure cleanup also runs without inventory --- helpers/cleanup | 6 +++--- helpers/run-in-test-cluster | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/helpers/cleanup b/helpers/cleanup index cacf5de..b8392f4 100755 --- a/helpers/cleanup +++ b/helpers/cleanup @@ -6,9 +6,9 @@ set -euo pipefail export CLUSTER_PREFIX="${CLUSTER_PREFIX-k8test}" -if ! test -f k8test/cluster/inventory.yml; then - exit 0 -fi +# Make sure the k8test/helpers/release-set CLI is available +source helpers/run-in-test-cluster +ensure-k8test > /dev/null k8test/playbooks/destroy-cluster.yml \ -i k8test/cluster/inventory.yml \ diff --git a/helpers/run-in-test-cluster b/helpers/run-in-test-cluster index 73c6139..2331c5c 100755 --- a/helpers/run-in-test-cluster +++ b/helpers/run-in-test-cluster @@ -19,7 +19,12 @@ function ensure-k8test() { # on the runners and cloning via SSH does not work. # # Therefore we run a separate install block that is only meant for GitHub. - if [[ "${GITHUB_ACTIONS:-}" == "true" ]]; then + if [[ "${GITHUB_ACTIONS:-}" == "true" ]] then + if test -d k8test; then + source k8test/venv/bin/activate + return + fi + mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts git clone https://github.com/cloudscale-ch/k8test python3 -m venv k8test/venv