Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System tests misc improvements #290

Merged
merged 45 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2b10c09
test/includes/microcloud: add loggroups to {reset,restore,new}_system…
simondeziel Apr 18, 2024
b4ac354
github: run tests on a weekly schedule
simondeziel Apr 19, 2024
cb5d11f
Revert "test/includes/microcloud: simplify rm -rf globbing"
simondeziel Apr 19, 2024
8e16f3e
test/includes/microcloud: don't configure enp6s0 in `setup_system()`
simondeziel Apr 19, 2024
bb66a35
github: use non-shallow clones for differential shellcheck
simondeziel Apr 19, 2024
fd8212e
github: be stricter with shellcheck
simondeziel Apr 19, 2024
72dc7df
github: use LXD latest/edge in the host VM
simondeziel Apr 19, 2024
6867c5f
test/includes/microcloud: remove warning
simondeziel Apr 19, 2024
ade11ac
test/includes/microcloud: snap install --dangerous is safer than --de…
simondeziel Apr 19, 2024
d48c248
test/main: kill our process group when CONCURRENT_SETUP=1
simondeziel Apr 19, 2024
4dd261b
test/main: add variables to select snap channels
simondeziel Apr 19, 2024
be0065c
test/includes/microcloud: use channel vars for all snaps
simondeziel Apr 19, 2024
d4495b4
test/suites/basic: use cohort and channel when re-installing micro{ce…
simondeziel Apr 19, 2024
369be9d
test/includes/check: add check_snap_channels()
simondeziel Apr 19, 2024
08a47c8
test/main: warn on non-latest/edge snap channels
simondeziel Apr 19, 2024
640ca7a
test/main: use 22.03/edge for microovn
simondeziel Apr 19, 2024
50b9d20
test/main: warn on non-latest/edge snap channels
simondeziel Apr 19, 2024
6ef3b62
test/includes/microcloud: don't blow up downloaded images between cle…
simondeziel Apr 20, 2024
819549d
test/suites/preseed: less subshell
simondeziel Apr 20, 2024
47bd0cd
test/main: switch to bash
simondeziel Apr 20, 2024
680bf42
test/includes/check: switch to bash
simondeziel Apr 20, 2024
1c8e4be
test/suites/add: switch to bash
simondeziel Apr 20, 2024
9b4d2b5
test/suites/add: switch to bash
simondeziel Apr 20, 2024
29d773e
test/suites/add: switch to bash
simondeziel Apr 20, 2024
c9033c0
test/includes/microcloud: switch to bash
simondeziel Apr 20, 2024
bd947b4
test/includes/microcloud: remove unneeded quoting
simondeziel Apr 20, 2024
8b18a14
test/includes/microcloud: replace printf by formated seq output
simondeziel Apr 20, 2024
c6afd32
test/suites/basic: replace printf by formated seq output
simondeziel Apr 20, 2024
dd0957f
test/includes/microcloud: use bash regex matching
simondeziel Apr 20, 2024
b702952
test/includes/microcloud: feed var directly to grep (less log noise)
simondeziel Apr 20, 2024
be10f36
test/includes/microcloud: simplify lxd_wait_vm ready check
simondeziel Apr 20, 2024
b23f9a5
test/suites/basic: simplify lxd_wait_vm ready check
simondeziel Apr 20, 2024
9c5bc0e
test/includes/microcloud: blkdiscard the TEST_STORAGE_SOURCE disk
simondeziel Apr 21, 2024
a9a813f
test/main: list all instances during cleanup
simondeziel Apr 21, 2024
52ddddf
test/includes/microcloud: use output comparison instead of grep
simondeziel Apr 21, 2024
c7f005d
test/suites/add: use output comparison instead of grep
simondeziel Apr 21, 2024
8fee868
test/suites/basic: use output comparison instead of grep
simondeziel Apr 21, 2024
468e719
test/includes/microcloud: tweak lxd_wait_vm()
simondeziel Apr 21, 2024
ed7f557
test/main: add notice level around tests
simondeziel Apr 22, 2024
6317f8a
test/includes/microcloud: reduce set -x log noise
simondeziel Apr 22, 2024
ab5d045
github: prepare debug binaries in the build step
simondeziel Apr 22, 2024
1780226
github: split system-tests run into more steps
simondeziel Apr 22, 2024
c9f2a92
test/includes/microcloud: undoing workaround for LXD shutdown bug
simondeziel Apr 24, 2024
515ba27
test/main: split test between more and smaller groups
simondeziel Apr 24, 2024
5c536bd
github: run more parallel system tests
simondeziel Apr 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 37 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Tests
on:
schedule:
- cron: '0 0 * * 0' # Weekly on Sunday at 00:00 UTC
push:
branches:
- main
Expand All @@ -25,6 +27,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# A non-shallow clone is needed for the Differential ShellCheck
fetch-depth: 0

- name: Dependency Review
uses: actions/dependency-review-action@v4
Expand All @@ -35,6 +40,7 @@ jobs:
uses: redhat-plumbers-in-action/differential-shellcheck@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
strict-check-on-push: true
if: github.event_name == 'pull_request'

- name: Upload artifact with ShellCheck defects in SARIF format
Expand Down Expand Up @@ -84,7 +90,13 @@ jobs:
fail-fast: false
matrix:
go: ["1.22.x"]
suite: ["add", "basic", "preseed"]
suite:
- "add"
- "auto"
- "basic"
- "interactive"
- "mismatch"
- "preseed"

steps:
- name: Performance tuning
Expand Down Expand Up @@ -142,9 +154,22 @@ jobs:

- name: Build
working-directory: microcloud
run: make
run: |
set -eux

- name: "Run system tests (${{ matrix.go }}, ${{ matrix.suite }})"
make

# Binaries to sideload
export MICROCLOUD_DEBUG_PATH=~/go/bin/microcloud
export MICROCLOUDD_DEBUG_PATH=~/go/bin/microcloudd

# strip debug binaries
strip -s "${MICROCLOUD_DEBUG_PATH}" "${MICROCLOUDD_DEBUG_PATH}"

echo "MICROCLOUD_DEBUG_PATH=${MICROCLOUD_DEBUG_PATH}" >> "${GITHUB_ENV}"
echo "MICROCLOUDD_DEBUG_PATH=${MICROCLOUDD_DEBUG_PATH}" >> "${GITHUB_ENV}"

- name: "Free up the ephemeral disk"
run: |
set -eux

Expand All @@ -165,17 +190,17 @@ jobs:
sudo wipefs -a "${ephemeral_disk}"
export TEST_STORAGE_SOURCE="${ephemeral_disk}"

# Setup host LXD
sudo snap install lxd --channel 5.21/stable || sudo snap refresh lxd --channel 5.21/stable
sudo lxd init --auto
echo "TEST_STORAGE_SOURCE=${TEST_STORAGE_SOURCE}" >> "${GITHUB_ENV}"

# Binaries to sideload
export MICROCLOUD_DEBUG_PATH=~/go/bin/microcloud
export MICROCLOUDD_DEBUG_PATH=~/go/bin/microcloudd

# strip debug binaries
strip -s "${MICROCLOUD_DEBUG_PATH}" "${MICROCLOUDD_DEBUG_PATH}"
- name: "Setup host LXD"
run: |
set -eux
sudo snap install lxd --channel latest/edge || sudo snap refresh lxd --channel latest/edge
sudo lxd init --auto

- name: "Run system tests (${{ matrix.go }}, ${{ matrix.suite }})"
run: |
set -eux
chmod +x ~
cd microcloud/test
sudo --preserve-env=DEBUG,GITHUB_ACTIONS,MICROCLOUD_DEBUG_PATH,MICROCLOUDD_DEBUG_PATH,SKIP_VM_LAUNCH,SNAPSHOT_RESTORE,TEST_STORAGE_SOURCE ./main.sh ${{ matrix.suite }}
Expand Down
21 changes: 21 additions & 0 deletions microcloud/test/includes/check.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# Miscellaneous test checks.

check_dependencies() {
Expand Down Expand Up @@ -30,3 +31,23 @@ check_empty() {
false
fi
}

check_snap_channels() {
non_edge=""
if [ "${LXD_SNAP_CHANNEL}" != "latest/edge" ]; then
non_edge="${non_edge} lxd"
fi
if [ "${MICROCEPH_SNAP_CHANNEL}" != "latest/edge" ]; then
non_edge="${non_edge} microceph"
fi
if [ "${MICROCLOUD_SNAP_CHANNEL}" != "latest/edge" ]; then
non_edge="${non_edge} microcloud"
fi
if [ "${MICROOVN_SNAP_CHANNEL}" != "latest/edge" ]; then
non_edge="${non_edge} microovn"
fi

for snap in ${non_edge}; do
echo "::warning::${snap} channel not set to latest/edge, continuing anyway"
done
}
Loading
Loading