1616from .logger import Logger
1717from .pgo import setup_pgo_tests
1818from .result import TestResult
19- from .results import TestResults , EXITCODE_INTERRUPTED , annotate_github
19+ from .results import TestResults , EXITCODE_INTERRUPTED
2020from .runtests import RunTests , HuntRefleak
2121from .setup import setup_process , setup_test_dir
2222from .single import run_single_test , PROGRESS_MIN_TIME
2727 printlist , get_temp_dir , get_work_dir , exit_timeout ,
2828 display_header , cleanup_temp_dir , print_warning ,
2929 is_cross_compiled , get_host_runner , display_title ,
30- get_process_memory_usage , EXIT_TIMEOUT )
30+ get_process_memory_usage , github_annotation , EXIT_TIMEOUT )
3131
3232
3333class Regrtest :
@@ -491,10 +491,6 @@ def write_github_summary(self) -> None:
491491 return
492492 # Tests which failed in the last run (the re-run, if any)
493493 failed = self .results .rerun_results
494- if not self .results .rerun :
495- # Failed tests were not re-run (ex: --python): annotate them now
496- for result in failed :
497- annotate_github (result )
498494 cases = [(result .errors or []) + (result .failures or [])
499495 for result in failed ]
500496 ncase = sum (map (len , cases ))
@@ -511,7 +507,14 @@ def write(text: str) -> None:
511507 if result .env_changed_reasons :
512508 write ("\n " .join (f"- { reason } "
513509 for reason in result .env_changed_reasons ))
510+ if not result_cases :
511+ message = "\n " .join ([str (result ),
512+ * (result .env_changed_reasons or ())])
513+ github_annotation ("error" , result .test_name ,
514+ decolor (message ))
514515 for name , traceback in result_cases :
516+ github_annotation ("error" , f"{ result .test_name } : { name } " ,
517+ decolor (traceback ))
515518 # Expand short tracebacks when there are only a few
516519 is_open = ncase <= 5 and traceback .count ("\n " ) < 30
517520 write (f"<details{ ' open' if is_open else '' } >"
0 commit comments