Skip to content

Commit

Permalink
Integrate Autopilot tests into the shared smoke tests
Browse files Browse the repository at this point in the history
Downloading the k0s release was the only difference. Add an optional
input for that. Make the job name configurable, too. This is mainly used
to distinguish potential artifact uploads between the ap-ha3x3 smoke
test and the Autopilot upgrate checks.

Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
  • Loading branch information
twz123 committed Jun 27, 2024
1 parent 5a83ff7 commit 271b432
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 49 deletions.
53 changes: 6 additions & 47 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,55 +219,14 @@ jobs:
matrix:
version: ${{fromJson(needs.prepare.outputs.autopilot-matrix)}}

name: "Autopilot tests :: ${{ matrix.version }}"
name: "Autopilot test :: ${{ matrix.version }}"
needs: [prepare, build-k0s]
runs-on: ubuntu-22.04

env:
K0S_VERSION: ${{ matrix.version }}

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Reclaim runner disk space
run: .github/workflows/reclaim-runner-disk-space.bash

- name: Prepare build environment
run: .github/workflows/prepare-build-env.sh

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}

- name: Download compiled executable
uses: actions/download-artifact@v4
with:
name: k0s-linux-amd64

- name: Download latest release
run: |
curl -L -o "k0s-$K0S_VERSION" "https://github.com/k0sproject/k0s/releases/download/$K0S_VERSION/k0s-$K0S_VERSION-amd64"
chmod +x "k0s-$K0S_VERSION"
- name: k0s sysinfo
run: |
chmod +x k0s
./k0s sysinfo
- name: Run inttest
run: |
make -C inttest check-ap-ha3x3 K0S_UPDATE_FROM_BIN="../k0s-$K0S_VERSION"
- name: Collect k0s logs and support bundle
if: failure()
uses: actions/upload-artifact@v4
with:
name: autopilot-tests-${{ matrix.version }}-files
path: |
/tmp/*.log
/tmp/support-bundle.tar.gz
uses: ./.github/workflows/smoketest.yaml
with:
name: ap-ha3x3
job-name: autopilot-test
k0s-reference-version: ${{ matrix.version }}

smoketest-arm:
name: Smoke test on armv7/arm64
Expand Down
27 changes: 25 additions & 2 deletions .github/workflows/smoketest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@ on:
type: string
required: true
description: The integration test name to be executed.
job-name:
type: string
default: smoketest
description: >-
The name to use for the test job.
Will be used as a prefix for artifact uploads.
k0s-reference-version:
type: string
description: >-
The k0s release version to be used as a reference.
Mostly used for Autopilot upgrade checks.
permissions:
contents: read

jobs:
smoketest:
name: Smoke test
name: ${{ inputs.job-name }}
runs-on: ubuntu-22.04

steps:
Expand Down Expand Up @@ -57,16 +68,28 @@ jobs:
with:
name: airgap-image-bundle-linux-amd64

- name: Download k0s reference release
id: download-k0s-reference-release
if: inputs.k0s-reference-version != ''
env:
K0S_VERSION: ${{ inputs.k0s-reference-version }}
run: |
curl --proto '=https' --tlsv1.2 -sSLo "k0s-$K0S_VERSION" --retry 5 --retry-all-errors "https://github.com/k0sproject/k0s/releases/download/$K0S_VERSION/k0s-$K0S_VERSION-amd64"
chmod +x "k0s-$K0S_VERSION"
k0sRealPath="$(realpath "k0s-$K0S_VERSION")"
echo "path=$k0sRealPath" >>$GITHUB_OUTPUT
- name: Run inttest
env:
SMOKETEST_NAME: check-${{ inputs.name }}
K0S_UPDATE_FROM_PATH: ${{ steps.download-k0s-reference-release.outputs.path }}
run: make -C inttest "$SMOKETEST_NAME"

- name: Collect k0s logs, support bundle and conformance test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: smoketest-${{ inputs.name }}-files
name: ${{ inputs.job-name }}-${{ inputs.name }}-files
path: |
/tmp/*.log
/tmp/support-bundle.tar.gz
Expand Down

0 comments on commit 271b432

Please sign in to comment.