Skip to content

Commit

Permalink
Run docker tests in integration GH Action CI
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed Mar 6, 2024
1 parent b81f3b2 commit e30f760
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 19 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 $?"
36 changes: 19 additions & 17 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -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' ] && \
Expand Down

0 comments on commit e30f760

Please sign in to comment.