-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There are a few issues running the Longhorn integration tests on an LXD runner, as we currently are, mainly having to do with ISCSI volumes being exposed and mounted in LXD. Running on host has its own issues, mainly the Pods have cluster-wide connectivity issues. Instead, we'll be testing Longhorn in a multipass VM. We also remove some of the GitHub runner's bloat in order to free up sufficient space for the VM and test. Note that according to the Longhorn deployment guide, Longhorn requires 25% of the root disk to be available (if no other disks are available).
- Loading branch information
1 parent
60f7d7b
commit 67bb6a0
Showing
2 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Run rocks tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
rock-metas: | ||
description: List of maps featuring the built {name, version, path, arch, image} | ||
type: string | ||
default: "[]" | ||
|
||
jobs: | ||
run-tests: | ||
if: ${{ inputs.rock-metas != '[]' }} | ||
name: Run tests | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Maximize build space | ||
uses: AdityaGarg8/remove-unwanted-software@v4.1 | ||
with: | ||
remove-android: 'true' | ||
remove-haskell: 'true' | ||
remove-codeql: 'true' | ||
remove-swapfile: 'true' | ||
- name: Checkout repository | ||
uses: actions/checkout@v4.1.1 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
- name: Setup environment | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y jq | ||
pip install tox | ||
- name: Install multipass | ||
run: | | ||
set -x | ||
sudo snap install multipass | ||
# We need to authenticate into multipass, since we're not running as root. | ||
# https://github.com/canonical/multipass/issues/1437#issuecomment-1435357872 | ||
sudo multipass set local.passphrase=Passw0rd | ||
# If we auth too soon, we might get this error: | ||
# authenticate failed: cannot connect to the multipass socket | ||
sleep 3 | ||
multipass auth Passw0rd | ||
- name: Set rock image environment variables | ||
run: | | ||
# NOTE(aznashwan): these env var names are maintained for backwards | ||
# compatibility, but new tests should ideally use the utility functions | ||
# from the shared testing harnesss repository to directly read the | ||
# values from the below-set BUILT_ROCKS_METADATA environment variable. | ||
# https://github.com/canonical/k8s-test-harness/blob/main/k8s_test_harness/util/env_util.py | ||
echo '${{ inputs.rock-metas }}' | jq -c '.[] | select(.arch == "amd64") ' | while read i; do | ||
name=$(echo "$i" | jq -r '.name' | tr '[:lower:]' '[:upper:]' | tr '-' '_') | ||
image=$(echo "$i" | jq -r '.image') | ||
echo "ROCK_$name=$image" >> $GITHUB_ENV | ||
done | ||
- name: Run integration tests | ||
env: | ||
BUILT_ROCKS_METADATA: ${{ inputs.rock-metas }} | ||
run: | | ||
export TEST_SNAP_CHANNEL="latest/edge" | ||
export TEST_SUBSTRATE=multipass | ||
export TEST_MULTIPASS_MEMORY=6G | ||
export TEST_MULTIPASS_DISK=40G | ||
tox --conf tests/tox.ini -e integration |