Skip to content

Commit fdeff21

Browse files
committed
add daily CI tests
for additional testing in addition to what is done by dist check tested is eg. the Reed-Solomon problem that occured between 1.8.5 and 1.8.6
1 parent 258b598 commit fdeff21

3 files changed

Lines changed: 148 additions & 0 deletions

File tree

.github/scripts/run_tests.sh

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#!/bin/sh -eu
2+
#
3+
# THis scripts is called by .github/workflows/daily_tests.yml
4+
# The idea is to do some further functional UltraGrid tests
5+
6+
# see also (taken from) .github/scripts/Linux/utils/Dockerfile.ubuntu
7+
ubuntu_packages="
8+
libasound2t64\
9+
libegl1\
10+
libfontconfig1\
11+
libglx-mesa0\
12+
libgmp10\
13+
libharfbuzz0b\
14+
libopengl0\
15+
libp11-kit0\
16+
libx11-6\
17+
openbox\
18+
xvfb"
19+
20+
case "$RUNNER_OS" in
21+
Linux)
22+
sudo apt update
23+
sudo apt -y install $ubuntu_packages
24+
Xvfb :99 -screen 0 1920x1080x24 &
25+
export DISPLAY=:99
26+
openbox &
27+
28+
ug_build=UltraGrid-continuous-x86_64.AppImage
29+
prepare() {
30+
chmod +x "$ug_build"
31+
./"$ug_build" --appimage-extract
32+
}
33+
run_uv=squashfs-root/AppRun
34+
run_reflector="squashfs-root/AppRun -o hd-rum-transcode"
35+
;;
36+
Windows)
37+
ug_build=UltraGrid-continuous-win64.zip
38+
prepare() {
39+
unzip "$ug_build"
40+
}
41+
run_uv=UltraGrid-continuous-win64/uv.exe
42+
run_reflector=UltraGrid-continuous-win64/hd-rum-transcode.exe
43+
;;
44+
macOS)
45+
ug_build=UltraGrid-continuous-arm64.dmg
46+
prepare() {
47+
hdiutil mount "$ug_build"
48+
}
49+
brew install coreutils
50+
alias timeout=gtimeout
51+
run_uv=/Volumes/ULTRAGRID/uv-qt.app/Contents/MacOS/uv
52+
run_reflector=/Volumes/ULTRAGRID/uv-qt.app/Contents/MacOS/\
53+
hd-rum-transcode
54+
esac
55+
56+
curl -LOf https://github.com/CESNET/UltraGrid/releases/download/continuous/\
57+
"$ug_build"
58+
59+
prepare
60+
61+
## used by run_test_data.sh
62+
## @param $1 args
63+
## @param $2 opts (optional, separated by comma) - should_fail or should_timeout,
64+
## run_reflector
65+
add_test() {
66+
eval "test_${test_count}_args=\${1?}"
67+
eval "test_${test_count}_opts=\${2-}"
68+
test_count=$((test_count + 1))
69+
}
70+
71+
test_count=0
72+
. "$(dirname "$0")"/run_tests_data.sh
73+
74+
set +e
75+
i=0
76+
while [ $i -lt $test_count ]; do
77+
eval "args=\$test_${i}_args"
78+
eval "opts=\$test_${i}_opts"
79+
80+
exec=$run_uv
81+
tool=uv
82+
if expr -- "$opts" : '.*run_reflector' >/dev/null; then
83+
tool=reflector
84+
exec=$run_reflector
85+
fi
86+
87+
timeout=5
88+
timeout $timeout $exec $args
89+
rc=$?
90+
91+
if [ $rc = 124 ]; then
92+
if ! expr -- "$opts" : '.*should_timeout' >/dev/null; then
93+
printf "$tool with arguments %s timeout (limit: %d sec)!\n" \
94+
"$args" "$timeout"
95+
exit 1
96+
fi
97+
elif expr -- "$opts" : '.*should_fail' >/dev/null; then
98+
if [ $rc -eq 0 ]; then
99+
printf "$tool with arguments %s should have failed but\
100+
returned 0!\n" "$args"
101+
exit 1
102+
fi
103+
else
104+
if [ $rc -ne 0 ]; then
105+
printf "$tool with arguments %s returned %d but should have\
106+
succeeeded!\n" "$args" "$rc"
107+
exit 1
108+
fi
109+
110+
fi
111+
112+
i=$((i + 1))
113+
done
114+

.github/scripts/run_tests_data.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
add_test -v # basic sanity test
2+
add_test --nonexistent-param should_fail
3+
add_test "-d sdl" should_timeout
4+
add_test "-t testcard -c lavc:e=libx265 -f rs" should_timeout
5+
6+
# reflector
7+
add_test -v run_reflector # basic sanity test
8+
add_test "8M 5004" run_reflector,should_timeout

.github/workflows/daily_tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Continuous daily build tests
2+
3+
on:
4+
push:
5+
branches:
6+
- run_tests
7+
schedule:
8+
- cron: '30 4 * * *' # daily at 4:30 UTC
9+
10+
jobs:
11+
run_tests:
12+
if: github.repository == 'CESNET/UltraGrid' || github.event.schedule == null
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
17+
runs-on: ${{ matrix.os }}
18+
defaults:
19+
run:
20+
shell: ${{ matrix.os == 'windows-latest' && 'C:\shells\msys2bash.cmd {0}' || 'bash {0}' }}
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Run
25+
shell: bash
26+
run: .github/scripts/run_tests.sh

0 commit comments

Comments
 (0)