mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-07-21 08:12:08 +02:00
43 lines
965 B
Bash
Executable File
43 lines
965 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eo pipefail
|
|
|
|
create_gitlab_report() {
|
|
local error="$1"
|
|
failure_report=$(cat <<EOF
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<testsuite name="Run test" tests="1" failures="1" errors="0" skipped="0">
|
|
<testcase classname="$os_fullname" name="Test run">
|
|
<failure type="description">${error}</failure>
|
|
</testcase>
|
|
</testsuite>
|
|
EOF
|
|
)
|
|
}
|
|
|
|
write_gitlab_report() {
|
|
echo "$failure_report" > run_test/"${os}_${os_codename}.xml"
|
|
}
|
|
|
|
saved_options=("$@")
|
|
. ./builder/process_test_options.sh
|
|
. ./builder/common.sh
|
|
|
|
os="$1"
|
|
os_codename="$2"
|
|
os_fullname="${os}_${os_codename}"
|
|
|
|
detect_package_format
|
|
if [ "$run_test" != 1 ]; then
|
|
builder/test-${package_format}-barebones "${saved_options[@]}"
|
|
exit $?
|
|
fi
|
|
|
|
mkdir -p run_test
|
|
if ! builder/test-${package_format}-barebones "${saved_options[@]}" 2>&1 | \
|
|
tee run_test/"${os_fullname}.log"; then
|
|
create_gitlab_report "$(tail -1 run_test/${os_fullname}.log)"
|
|
write_gitlab_report
|
|
exit 1
|
|
fi
|