-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split functional testings via github action matrix
This commit changes the workflow of the github actions. We split it into three parts this way: 1) build zfs modules (~15m) 2a) zloop tests (~10m) 2b) sanity tests (~25m) 2c) functional testings via five parts (each ~1h) 3) cleanup zfs modules of step 1 When everything runs fine, the full run should be done in about 2 hours. The checkstyle.yml is left untouched and should be okay. The testings are also modfied a bit: - report info about CPU and checksum benchmarks - remove workaround for cloud-init bug (issue 12644) - add Ubuntu 22.04 for build and zloop tests - the sanity and functional tests for 22.04 needs some more work Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
- Loading branch information
Showing
7 changed files
with
288 additions
and
245 deletions.
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,25 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
TDIR="/usr/share/zfs/zfs-tests/tests/functional" | ||
|
||
echo -n "TODO=" | ||
case "$1" in | ||
part1) | ||
echo "cli_root" | ||
;; | ||
part2) | ||
ls $TDIR|grep '^[a-h]'|grep -v "cli_root"|xargs|tr -s ' ' ',' | ||
;; | ||
part3) | ||
ls $TDIR|grep '^[i-q]'|xargs|tr -s ' ' ',' | ||
;; | ||
part4) | ||
ls $TDIR|grep '^r[aeo]'|xargs|tr -s ' ' ',' | ||
;; | ||
part5) | ||
echo -n "rsend," | ||
ls $TDIR|grep '^[s-z]'|xargs|tr -s ' ' ',' | ||
;; | ||
esac |
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,37 @@ | ||
acl | ||
alien | ||
attr | ||
autoconf | ||
bc | ||
curl | ||
dbench | ||
fakeroot | ||
fio | ||
gdb | ||
git | ||
ksh | ||
lcov | ||
libtool | ||
linux-tools-common | ||
lsscsi | ||
mdadm | ||
nfs-kernel-server | ||
pamtester | ||
parted | ||
pax | ||
python3 | ||
python3-cffi | ||
python3-dev | ||
python3-packaging | ||
python3-setuptools | ||
quota | ||
rng-tools | ||
rsync | ||
samba | ||
selinux-utils | ||
sysstat | ||
util-linux | ||
uuid-dev | ||
watchdog | ||
wget | ||
xz-utils |
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,224 @@ | ||
name: zfs-linux | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build OpenZFS | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [18.04, 20.04, 22.04] | ||
runs-on: ubuntu-${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt sudo apt-get install -qq | ||
sudo apt-get clean | ||
- name: Autogen.sh | ||
run: | | ||
./autogen.sh | ||
- name: Configure | ||
run: | | ||
./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan | ||
- name: Make | ||
run: | | ||
make -j$(nproc) --no-print-directory --silent pkg-utils pkg-kmod | ||
- name: Upload Modules | ||
run: | | ||
tar czvf ubuntu-${{ matrix.os }}.tgz scripts *.deb .github/workflows | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ubuntu-${{ matrix.os }} | ||
path: ubuntu-${{ matrix.os }}.tgz | ||
zloop: | ||
name: Doing zloop tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [18.04, 20.04, 22.04 ] | ||
runs-on: ubuntu-${{ matrix.os }} | ||
env: | ||
TEST_DIR: /var/tmp/zloop | ||
needs: build | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: ubuntu-${{ matrix.os }} | ||
- name: Clear the kernel ring buffer | ||
run: | | ||
sudo dmesg -c >/var/tmp/dmesg-prerun | ||
- name: Install | ||
run: | | ||
tar xzvf ubuntu-${{ matrix.os }}.tgz | ||
sudo apt-get update | ||
xargs --arg-file=.github/workflows/test-dependencies.txt sudo apt-get install -qq | ||
sudo apt-get clean | ||
sudo dpkg -i *.deb | ||
# Update order of directories to search for modules, otherwise | ||
# Ubuntu will load kernel-shipped ones. | ||
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf | ||
sudo depmod | ||
sudo modprobe zfs | ||
sudo dmesg | ||
- name: Tests | ||
run: | | ||
sudo mkdir -p $TEST_DIR | ||
# run for 10 minutes or at most 2 iterations for a maximum runner time of 20 minutes. | ||
sudo /usr/share/zfs/zloop.sh -t 600 -I 2 -l -m1 -- -T 120 -P 60 | ||
- name: Prepare artifacts | ||
if: failure() | ||
run: | | ||
sudo chmod +r -R $TEST_DIR/ | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: Logs-${{ matrix.os }} | ||
path: | | ||
/var/tmp/zloop/*/ | ||
!/var/tmp/zloop/*/vdev/ | ||
if-no-files-found: ignore | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: Pool files-${{ matrix.os }} | ||
path: | | ||
/var/tmp/zloop/*/vdev/ | ||
if-no-files-found: ignore | ||
tests-sanity: | ||
name: Sanity tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [18.04, 20.04 ] | ||
runs-on: ubuntu-${{ matrix.os }} | ||
needs: build | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: ubuntu-${{ matrix.os }} | ||
- name: Install dependencies | ||
run: | | ||
tar xzvf ubuntu-${{ matrix.os }}.tgz | ||
sudo apt-get update | ||
xargs --arg-file=.github/workflows/test-dependencies.txt sudo apt-get install -qq | ||
sudo apt-get clean | ||
sudo dpkg -i *.deb | ||
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf | ||
sudo depmod | ||
sudo modprobe zfs | ||
- name: Reclaim disk space | ||
run: | | ||
.github/workflows/scripts/reclaim_disk_space.sh | ||
- name: Clear the kernel ring buffer | ||
run: | | ||
sudo dmesg -c >/var/tmp/dmesg-prerun | ||
- name: Report CPU information | ||
run: | | ||
lscpu | ||
cat /proc/spl/kstat/zfs/chksum_bench | ||
- name: Report disk space | ||
run: | | ||
df -h / | ||
- name: Running sanity tests | ||
run: | | ||
set -o pipefail | ||
/usr/share/zfs/zfs-tests.sh -vKR -s 3G -r sanity | scripts/zfs-tests-color.sh | ||
shell: bash | ||
timeout-minutes: 330 | ||
- name: Prepare artifacts | ||
if: failure() | ||
run: | | ||
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current) | ||
sudo dmesg > $RESULTS_PATH/dmesg | ||
sudo cp /var/log/syslog /var/tmp/dmesg-prerun $RESULTS_PATH/ | ||
sudo chmod +r $RESULTS_PATH/* | ||
# Replace ':' in dir names, actions/upload-artifact doesn't support it | ||
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: Test logs Ubuntu-${{ matrix.os }} | ||
path: | | ||
/var/tmp/test_results/* | ||
!/var/tmp/test_results/current | ||
if-no-files-found: ignore | ||
tests-functional: | ||
name: Functional tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [18.04, 20.04 ] | ||
tests: [ part1, part2, part3, part4, part5 ] | ||
runs-on: ubuntu-${{ matrix.os }} | ||
needs: build | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: ubuntu-${{ matrix.os }} | ||
- name: Install dependencies | ||
run: | | ||
tar xzvf ubuntu-${{ matrix.os }}.tgz | ||
sudo apt-get update | ||
xargs --arg-file=.github/workflows/test-dependencies.txt sudo apt-get install -qq | ||
sudo apt-get clean | ||
sudo dpkg -i *.deb | ||
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf | ||
sudo depmod | ||
sudo modprobe zfs | ||
- name: Reclaim disk space | ||
run: | | ||
.github/workflows/scripts/reclaim_disk_space.sh | ||
- name: Clear the kernel ring buffer | ||
run: | | ||
sudo dmesg -c >/var/tmp/dmesg-prerun | ||
- name: Report CPU information | ||
run: | | ||
lscpu | ||
cat /proc/spl/kstat/zfs/chksum_bench | ||
- name: Report disk space | ||
run: | | ||
df -h / | ||
- name: Setup tests | ||
run: | | ||
.github/workflows/scripts/split_functional_tests.sh ${{ matrix.tests }} >> $GITHUB_ENV | ||
- name: Running tests ${{ matrix.tests }} | ||
run: | | ||
set -o pipefail | ||
/usr/share/zfs/zfs-tests.sh -vKR -s 3G -T ${{ env.TODO }} | scripts/zfs-tests-color.sh | ||
shell: bash | ||
timeout-minutes: 330 | ||
- name: Prepare artifacts | ||
if: failure() | ||
run: | | ||
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current) | ||
sudo dmesg > $RESULTS_PATH/dmesg | ||
sudo cp /var/log/syslog /var/tmp/dmesg-prerun $RESULTS_PATH/ | ||
sudo chmod +r $RESULTS_PATH/* | ||
# Replace ':' in dir names, actions/upload-artifact doesn't support it | ||
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: Test logs Ubuntu-${{ matrix.os }}-${{ matrix.tests }} | ||
path: | | ||
/var/tmp/test_results/* | ||
!/var/tmp/test_results/current | ||
if-no-files-found: ignore | ||
cleanup-modules: | ||
name: Cleanup unnecessary artifacts | ||
strategy: | ||
matrix: | ||
os: [18.04, 20.04, 22.04 ] | ||
runs-on: ubuntu-${{ matrix.os }} | ||
needs: [ zloop, tests-sanity, tests-functional ] | ||
steps: | ||
- uses: geekyeggo/delete-artifact@v2 | ||
with: | ||
name: ubuntu-${{ matrix.os }} |
Oops, something went wrong.