mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Produce junit results for verify job
This commit is contained in:
@@ -21,6 +21,9 @@ set -o pipefail
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/util.sh"
|
||||
|
||||
# include shell2junit library
|
||||
source "${KUBE_ROOT}/third_party/forked/shell2junit/sh2ju.sh"
|
||||
|
||||
# Excluded check patterns are always skipped.
|
||||
EXCLUDED_PATTERNS=(
|
||||
"verify-all.sh" # this script calls the make rule and would cause a loop
|
||||
@@ -69,11 +72,19 @@ function is-quick {
|
||||
}
|
||||
|
||||
function run-cmd {
|
||||
local filename="${2##*/verify-}"
|
||||
local testname="${filename%%.*}"
|
||||
local output="${KUBE_JUNIT_REPORT_DIR:-/tmp/junit-results}"
|
||||
local tr
|
||||
|
||||
if ${SILENT}; then
|
||||
"$@" &> /dev/null
|
||||
juLog -output="${output}" -class="verify" -name="${testname}" "$@" &> /dev/null
|
||||
tr=$?
|
||||
else
|
||||
"$@"
|
||||
juLog -output="${output}" -class="verify" -name="${testname}" "$@"
|
||||
tr=$?
|
||||
fi
|
||||
return ${tr}
|
||||
}
|
||||
|
||||
# Collect Failed tests in this Array , initalize it to nil
|
||||
@@ -149,7 +160,7 @@ run-checks "${KUBE_ROOT}/hack/verify-*.sh" bash
|
||||
run-checks "${KUBE_ROOT}/hack/verify-*.py" python
|
||||
|
||||
if [[ ${ret} -eq 1 ]]; then
|
||||
print-failed-tests
|
||||
print-failed-tests
|
||||
fi
|
||||
exit ${ret}
|
||||
|
||||
|
Reference in New Issue
Block a user