|
10 | 10 | # Usage: ./run-random-tests.sh [options] |
11 | 11 | # Options: |
12 | 12 | # -q, --quiet Suppress debug output |
| 13 | +# -f, --show-failures Print failed test output in summary (auto-enabled in GitHub Actions) |
13 | 14 | # -c, --component COMPONENT Test single COMPONENT (overrides config file) |
14 | 15 | # -n, --max-jobs MAX_JOBS Limit concurrent test jobs (auto-detect if omitted) |
15 | 16 | # -r, --repeat REPEAT Repeat full component run REPEAT times |
@@ -52,6 +53,7 @@ component="" |
52 | 53 | max_jobs="" |
53 | 54 | repeat_count=1 |
54 | 55 | timeout_seconds=300 |
| 56 | +show_failures="" |
55 | 57 | first_result=true |
56 | 58 | declare -a bg_pids=() |
57 | 59 |
|
@@ -277,6 +279,10 @@ parse_arguments() { |
277 | 279 | quiet="--quiet" |
278 | 280 | shift |
279 | 281 | ;; |
| 282 | + -f|--show-failures) |
| 283 | + show_failures="--show-failures" |
| 284 | + shift |
| 285 | + ;; |
280 | 286 | -c|--component) |
281 | 287 | if [[ $# -lt 2 ]]; then |
282 | 288 | print_error "Missing value for --component" |
@@ -344,6 +350,7 @@ show_help() { |
344 | 350 | echo "" |
345 | 351 | echo -e "${YELLOW}Options:${RESET}" |
346 | 352 | echo -e " ${GREEN}-q, --quiet${RESET} Suppress debug output" |
| 353 | + echo -e " ${GREEN}-f, --show-failures${RESET} Print failed test output in summary (auto-enabled in GitHub Actions)" |
347 | 354 | echo -e " ${GREEN}-c, --component COMPONENT${RESET} Test single ${GREEN}COMPONENT${RESET} (overrides config file)" |
348 | 355 | echo -e " ${GREEN}-n, --max-jobs MAX_JOBS${RESET} Limit concurrent test jobs (auto-detect if omitted)" |
349 | 356 | echo -e " ${GREEN}-r, --repeat REPEAT${RESET} Repeat full component run ${GREEN}REPEAT${RESET} times" |
@@ -758,6 +765,18 @@ print_summary() { |
758 | 765 | fi |
759 | 766 |
|
760 | 767 | echo -e " ${RED}✗${RESET} ${BOLD}$failed_component${RESET} ($result_file)" |
| 768 | + |
| 769 | + if [[ -n "${GITHUB_ACTIONS:-}" || "$show_failures" == "--show-failures" ]]; then |
| 770 | + if [[ -f "$result_file" ]]; then |
| 771 | + if [[ -n "${GITHUB_ACTIONS:-}" ]]; then |
| 772 | + echo "::group::Output: $failed_component" |
| 773 | + fi |
| 774 | + cat "$result_file" |
| 775 | + if [[ -n "${GITHUB_ACTIONS:-}" ]]; then |
| 776 | + echo "::endgroup::" |
| 777 | + fi |
| 778 | + fi |
| 779 | + fi |
761 | 780 | done < <(printf '%s\n' "${failed_components[@]}" | sort) |
762 | 781 | fi |
763 | 782 |
|
|
0 commit comments