|
104 | 104 |
|
105 | 105 | foldable end shutdown |
106 | 106 |
|
| 107 | +# Try to collect json summary from VM |
| 108 | +if [[ -n ${KERNEL_TEST} && ${KERNEL_TEST} =~ test_progs* ]] |
| 109 | +then |
| 110 | + guestfish --ro -a "$IMG" -i download "/${KERNEL_TEST}.json" "${KERNEL_TEST}.json" |
| 111 | + if [ $? ] |
| 112 | + then |
| 113 | + ## Job summary |
| 114 | + echo "# Tests summary" >> "${GITHUB_STEP_SUMMARY}" |
| 115 | + read -r T_SUCCESS T_SUCCESS_SUBTEST T_SKIPPED T_FAILED < \ |
| 116 | + <(jq -r < "${KERNEL_TEST}.json" '"\(.success) \(.success_subtest) \(.skipped) \(.failed)"') |
| 117 | + echo "- :heavy_check_mark: Success: ${T_SUCCESS}/${T_SUCCESS_SUBTEST} |
| 118 | +- :next_track_button: Skipped: ${T_SKIPPED} |
| 119 | +- :x: Failed: ${T_FAILED}" >> "${GITHUB_STEP_SUMMARY}" |
| 120 | + |
| 121 | + summary_annotation="Success: ${T_SUCCESS}/${T_SUCCESS_SUBTEST}, Skipped: ${T_SKIPPED}, Failed: ${T_FAILED}" |
| 122 | + echo "::notice::${summary_annotation}" |
| 123 | + |
| 124 | + # Print failed tests to summary/annotations |
| 125 | + if [ "${T_FAILED}" -gt 0 ] |
| 126 | + then |
| 127 | + echo "# Failed tests" >> "${GITHUB_STEP_SUMMARY}" |
| 128 | + jq -r < "${KERNEL_TEST}.json" \ |
| 129 | + '.results | map([ |
| 130 | + if .failed then "#\(.number) \(.name)" else empty end, |
| 131 | + ( |
| 132 | + . as {name: $tname, number: $tnum} | .subtests | map( |
| 133 | + if .failed then "#\($tnum)/\(.number) \($tname)/\(.name)" else empty end |
| 134 | + ) |
| 135 | + ) |
| 136 | + ]) | flatten | .[]' | \ |
| 137 | + while read -r line |
| 138 | + do |
| 139 | + # Job summary |
| 140 | + echo "${line}" >> "${GITHUB_STEP_SUMMARY}" |
| 141 | + # Annotations |
| 142 | + echo "::error::${line}" |
| 143 | + done |
| 144 | + fi |
| 145 | + fi |
| 146 | +fi |
107 | 147 | # Final summary - Don't use a fold, keep it visible |
108 | 148 | echo -e "\033[1;33mTest Results:\033[0m" |
109 | 149 | echo -e "$exitfile" | while read result; do |
|
0 commit comments