From e30f76011e2e41673fa40b64ebee90c2509277f9 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Wed, 6 Mar 2024 14:18:04 -0800 Subject: [PATCH] Run docker tests in integration GH Action CI Signed-off-by: Derek Nola --- .github/workflows/integration.yaml | 29 ++++++++++++++++++++++-- scripts/test | 36 ++++++++++++++++-------------- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 0868873e87a0..87b5703e85d3 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -30,10 +30,10 @@ env: jobs: build: uses: ./.github/workflows/build-k3s.yaml - test: + itest: needs: build name: Integration Tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest timeout-minutes: 45 strategy: fail-fast: false @@ -72,3 +72,28 @@ jobs: files: ./${{ matrix.itest }}.out flags: inttests # optional verbose: true # optional (default = false) + dtest: + needs: build + name: Docker Tests + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + dtest: [basics, bootstraptoken, cacerts, compat, hardened, lazypull, upgrade] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: "Download k3s binary" + uses: actions/download-artifact@v4 + with: + name: k3s + path: ./dist/artifacts + - name: Run Docker Test + run: | + chmod +x ./dist/artifacts/k3s + . ./tests/docker/test-helpers + . ./tests/docker/test-run-${{ matrix.itest }} + echo "Did test-run-${{ matrix.itest }} pass $?" \ No newline at end of file diff --git a/scripts/test b/scripts/test index b6b042fd32c8..64797c6f515d 100755 --- a/scripts/test +++ b/scripts/test @@ -20,31 +20,33 @@ mkdir -p $artifacts docker ps # --- +# Only run basic tests on non amd64 archs, we use GitHub Actions for amd64 +if [ "$ARCH" != 'amd64' ]; then -. ./tests/docker/test-run-basics -echo "Did test-run-basics $?" + . ./tests/docker/test-run-basics + echo "Did test-run-basics $?" -. ./tests/docker/test-run-compat -echo "Did test-run-compat $?" + . ./tests/docker/test-run-compat + echo "Did test-run-compat $?" -. ./tests/docker/test-run-hardened -echo "Did test-run-hardened $?" + . ./tests/docker/test-run-hardened + echo "Did test-run-hardened $?" -. ./tests/docker/test-run-cacerts -echo "Did test-run-cacerts $?" + . ./tests/docker/test-run-cacerts + echo "Did test-run-cacerts $?" -. ./tests/docker/test-run-bootstraptoken -echo "Did test-run-bootstraptoken $?" + . ./tests/docker/test-run-bootstraptoken + echo "Did test-run-bootstraptoken $?" -. ./tests/docker/test-run-upgrade -echo "Did test-run-upgrade $?" + . ./tests/docker/test-run-upgrade + echo "Did test-run-upgrade $?" -. ./tests/docker/test-run-etcd -echo "Did test-run-etcd $?" - -. ./tests/docker/test-run-lazypull -echo "Did test-run-lazypull $?" + . ./tests/docker/test-run-etcd + echo "Did test-run-etcd $?" + . ./tests/docker/test-run-lazypull + echo "Did test-run-lazypull $?" +fi # --- [ "$ARCH" != 'amd64' ] && \