Produce junit results for verify job

This commit is contained in:
Christoph Blecker
2018-01-25 13:30:25 -08:00
parent a624b94606
commit 5fe4d279ca
2 changed files with 34 additions and 14 deletions

View File

@@ -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}