-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathrun_all
More file actions
executable file
·45 lines (41 loc) · 1.21 KB
/
Copy pathrun_all
File metadata and controls
executable file
·45 lines (41 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
enable_x() {
local enable=true
while [ $# -gt 0 ] ; do
{ [ "$1" = "-q" ] || [ "$1" = "--quiet" ] ; } && enable=false
shift
done
$enable && set -x
}
enable_x "$@"
testdir=$(dirname "$(readlink -f "$0")")
result=0
mkdir -p scripts/testcov
for release in \
sle_12_sp5 \
sle_15_sp4 \
sle_15_sp7 \
16.0 \
opensuse_factory \
; do
echo "Running container for $release..."
container=$(podman run --rm -d -i -v ./scripts:/scripts:ro -v ./scripts/testcov:/output -w /scripts/python registry.opensuse.org/kernel/tools/images/$release/kernel-scripts:latest sleep 1h)
ret=$?
podman exec "$container" git config --global user.email "you@example.com"
podman exec "$container" git config --global user.name "Your Name"
if ! [ $ret -eq 0 ] ; then
result=$ret
continue
fi
echo "Running tests in $release:"
podman exec -e COVERAGE_FILE=/output/.coverage "$container" coverage run --source=. -m unittest discover -v "$@"
ret=$?
podman exec -e COVERAGE_FILE=/output/.coverage "$container" coverage report
podman exec -e COVERAGE_FILE=/output/.coverage "$container" coverage html --skip-covered -d /output/$release
podman stop -t 0 "$container"
if ! [ $ret -eq 0 ] ; then
result=$ret
continue
fi
done
exit $result