Skip to content

Commit

Permalink
Hutter's changes to qemu
Browse files Browse the repository at this point in the history
- Add Summary section to results
- Add URL to Summary for quick download of logs
  • Loading branch information
tonyhutter committed Aug 2, 2024
1 parent e68f902 commit 36e3410
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 16 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/scripts/qemu-6-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ esac
cd /var/tmp
uname -a > uname.txt

# ONLY FOR TESTING DO NOT COMMIT
#
# Run one 30th of the tests to save time
# DEN=30
DEN=$3

# run functional testings
$TDIR/zfs-tests.sh -vK -s 3G -T $2/$3
$TDIR/zfs-tests.sh -vK -s 3G -T $2/$DEN
RV=$?

# we wont fail here, this will be done later
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/scripts/qemu-7-reports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,17 @@ for i in `seq 1 $VMs`; do
echo "##[endgroup]"
done

RESPATH="/var/tmp/test_results"

# all tests without grouping:
MERGE="$BASE/.github/workflows/scripts/merge_summary.awk"
$MERGE vm*log.txt | $BASE/scripts/zfs-tests-color.sh
$MERGE vm*log.txt | $BASE/scripts/zfs-tests-color.sh | tee $RESPATH/summary.txt

# Save a list of all failed test logs for easy access
cp $RESPATH/summary.txt $RESPATH/summary-with-logs.txt
awk '/\[FAIL\]|\[KILLED\]/{ show=1; print; next; }; /\[SKIP\]|\[PASS\]/{ show=0; } show' \
$RESPATH/vm*/current/log >> $RESPATH/summary-failure-logs.txt

RESPATH="/var/tmp/test_results"
for i in `seq 1 $VMs`; do
rsync -arL zfs@192.168.122.1$i:$RESPATH/current $RESPATH/vm$i || true
scp zfs@192.168.122.1$i:"/var/tmp/*.txt" $RESPATH/vm$i || true
Expand Down
58 changes: 45 additions & 13 deletions .github/workflows/zfs-qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,31 @@ jobs:
matrix:
# all:
# os: [almalinux8, almalinux9, archlinux, centos-stream9, fedora39, fedora40, debian11, debian12, freebsd13, freebsd13r, freebsd14, freebsd14r, freebsd15, ubuntu20, ubuntu22, ubuntu24]
os: [almalinux8, almalinux9, centos-stream9, fedora39, fedora40, debian11, debian12, freebsd13, freebsd13r, freebsd14, freebsd14r, freebsd15, ubuntu20, ubuntu22, ubuntu24]
# os: [almalinux8, almalinux9, centos-stream9, fedora39, fedora40, debian11, debian12, freebsd13, freebsd13r, freebsd14, freebsd14r, freebsd15, ubuntu20, ubuntu22, ubuntu24]
# openzfs:
# os: [almalinux8, almalinux9, centos-stream9, fedora39, fedora40, freebsd13, freebsd13r, freebsd14, freebsd14r, freebsd15, ubuntu20, ubuntu22, ubuntu24]
# freebsd:
os: [almalinux8, almalinux9, fedora39, fedora40, freebsd13, freebsd14, freebsd15, ubuntu20, ubuntu22, ubuntu24]

# os: [freebsd13, freebsd13r, freebsd14, freebsd14r, freebsd15]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup SSH
run: |
mkdir -p $HOME/.ssh
echo "ConnectTimeout 1" >> $HOME/.ssh/config
echo "StrictHostKeyChecking no" >> $HOME/.ssh/config
echo "${{ secrets.AUTHORIZED_KEYS }}" >> $HOME/.ssh/authorized_keys
echo "${{ secrets.SSH_KEY }}" > $HOME/.ssh/id_ed25519
echo "${{ secrets.KNOWN_HOSTS }}" >> $HOME/.ssh/known_hosts
chmod 600 $HOME/.ssh/id_ed25519
R=`shuf -n 1 -i 10000-60000`
echo "Port $R"
ssh -x -N -C -f -R $R:127.0.0.1:22 mcmilk@${{ secrets.SOME_HOST }}
# - name: Setup SSH
# run: |
# mkdir -p $HOME/.ssh
# echo "ConnectTimeout 1" >> $HOME/.ssh/config
# echo "StrictHostKeyChecking no" >> $HOME/.ssh/config
# echo "${{ secrets.AUTHORIZED_KEYS }}" >> $HOME/.ssh/authorized_keys
# echo "${{ secrets.SSH_KEY }}" > $HOME/.ssh/id_ed25519
# echo "${{ secrets.KNOWN_HOSTS }}" >> $HOME/.ssh/known_hosts
# chmod 600 $HOME/.ssh/id_ed25519
# R=`shuf -n 1 -i 10000-60000`
# echo "Port $R"
# ssh -x -N -C -f -R $R:127.0.0.1:22 mcmilk@${{ secrets.SOME_HOST }}

- name: Setup QEMU
timeout-minutes: 10
Expand Down Expand Up @@ -87,12 +89,42 @@ jobs:
run: .github/workflows/scripts/qemu-7-reports.sh

- uses: actions/upload-artifact@v4
id: artifact-upload-step
if: always()
with:
name: Logs-functional-${{ matrix.os }}
path: /tmp/qemu-${{ matrix.os }}.tar
if-no-files-found: ignore

- name: Test Summary
if: success() || failure()
run: |
cat /var/tmp/test_results/summary.txt
echo "Full logs for download:"
echo '${{ steps.artifact-upload-step.outputs.artifact-url }}'
# Did we have a test failure?
if grep -vq 0 /var/tmp/test_results/vm*/exitcode.txt ; then
echo "One or more tests failed"
echo "### FIND "
find /var/tmp/test_results/
echo "### END FIND"
cat /var/tmp/test_results/summary-failure-logs.txt
# On test failures, the github test results page will autoscroll to the
# bottom of summary-with-logs.txt. The first thing we want to see
# is the summary page of failures so print another copy of it at
# the bottom of the "page" for easy access.
echo ""
cat /var/tmp/test_results/summary.txt
echo "Full logs for download:"
echo '${{ steps.artifact-upload-step.outputs.artifact-url }}'
false
else
true
fi
cleanup:
if: always()
name: Cleanup
Expand Down

0 comments on commit 36e3410

Please sign in to comment.