mirror of
https://github.com/flatcar/scripts.git
synced 2026-02-27 02:21:37 +01:00
Merge pull request #774 from flatcar/scripts
tapfile_helper: fix foldable details output
This commit is contained in:
commit
6a8ffb93d1
@ -220,6 +220,7 @@ __tap_print_test_verdict() {
|
||||
local name="$2"
|
||||
local succeded_vendors="$3"
|
||||
local failed_vendors="$4"
|
||||
local full_error_report="$5" # ignored
|
||||
|
||||
echo "${verdict} - ${test_name}"
|
||||
echo " ---"
|
||||
@ -246,6 +247,8 @@ __tap_finish_test_verdict() {
|
||||
local name="$2"
|
||||
local succeded_vendors="$3"
|
||||
local failed_vendors="$4"
|
||||
local full_error_report="$5" # ignored
|
||||
|
||||
echo " ..."
|
||||
}
|
||||
# --
|
||||
@ -275,6 +278,7 @@ __md_print_test_verdict() {
|
||||
local succeded_vendors="$3"
|
||||
local failed_vendors="$4"
|
||||
|
||||
|
||||
v=""
|
||||
if [ "${verdict}" = "not ok" ] ; then
|
||||
v=""
|
||||
@ -289,7 +293,8 @@ __md_print_test_verdict() {
|
||||
echo -n " ❌ Failed: ${failed_vendors}"
|
||||
fi
|
||||
echo
|
||||
if [ "${verdict}" = "not ok" ] ; then
|
||||
if [ "${verdict}" = "not ok" ] \
|
||||
|| [ "${full_error_report}" = "true" -a "${failed_vendors}" ] ; then
|
||||
echo
|
||||
echo "<details>"
|
||||
echo
|
||||
@ -301,7 +306,7 @@ __md_print_test_run_diag_output() {
|
||||
local vendor="$1"
|
||||
local run="$2"
|
||||
|
||||
echo "* Diagnostic output for ${vendor}, run ${run}"
|
||||
echo "<summary> Diagnostic output for ${vendor}, run ${run}</summary>"
|
||||
echo
|
||||
echo " \`\`\`"
|
||||
cat -
|
||||
@ -316,7 +321,10 @@ __md_finish_test_verdict() {
|
||||
local name="$2"
|
||||
local succeded_vendors="$3"
|
||||
local failed_vendors="$4"
|
||||
if [ "${verdict}" = "not ok" ] ; then
|
||||
local full_error_report="$5" # ignored
|
||||
|
||||
if [ "${verdict}" = "not ok" ] \
|
||||
|| [ "${full_error_report}" = "true" -a "${failed_vendors}" ] ; then
|
||||
echo
|
||||
echo "</details>"
|
||||
echo
|
||||
@ -414,7 +422,7 @@ function tap_generate_report() {
|
||||
failed="$(list_runs 0)"
|
||||
|
||||
__"${format}"_print_test_verdict "${verdict}" "${test_name}" \
|
||||
"${succeeded}" "${failed}"
|
||||
"${succeeded}" "${failed}" "${full_error_report}"
|
||||
if [ -n "${failed}" ] ; then
|
||||
if [ "${verdict}" = "not ok" -o "${full_error_report}" = "true" ] ; then
|
||||
# generate diagnostic output, per failed run.
|
||||
@ -440,7 +448,7 @@ function tap_generate_report() {
|
||||
fi
|
||||
fi
|
||||
__"${format}"_finish_test_verdict "${verdict}" "${test_name}" \
|
||||
"${succeeded}" "${failed}"
|
||||
"${succeeded}" "${failed}" "${full_error_report}"
|
||||
done
|
||||
|
||||
__"${format}"_finish_test_report
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user