Skip to content

Commit

Permalink
Split functional testings via github action matrix
Browse files Browse the repository at this point in the history
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
mcmilk committed Oct 24, 2022
1 parent 0b2428d commit 237f3c7
Show file tree
Hide file tree
Showing 7 changed files with 288 additions and 245 deletions.
25 changes: 2 additions & 23 deletions .github/workflows/build-dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
acl
alien
attr
autoconf
bc
automake
build-essential
curl
dbench
fakeroot
fio
gdb
gdebi
gawk
git
ksh
lcov
libacl1-dev
libaio-dev
libattr1-dev
Expand All @@ -27,23 +19,10 @@ libselinux-dev
libssl-dev
libtool
libudev-dev
lsscsi
mdadm
nfs-kernel-server
pamtester
parted
python3
python3-cffi
python3-dev
python3-packaging
python3-setuptools
rng-tools
rsync
samba
sysstat
uuid-dev
watchdog
wget
xfslibs-dev
xz-utils
zlib1g-dev
25 changes: 25 additions & 0 deletions .github/workflows/scripts/split_functional_tests.sh
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
37 changes: 37 additions & 0 deletions .github/workflows/test-dependencies.txt
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
224 changes: 224 additions & 0 deletions .github/workflows/zfs-build.yaml
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 }}
Loading

0 comments on commit 237f3c7

Please sign in to comment.