From 5e4f0e1c14ea0b971df9a46f15cadfb8bdb154e4 Mon Sep 17 00:00:00 2001 From: Moshe Atlow Date: Sun, 13 Aug 2023 09:46:38 +0300 Subject: [PATCH] tools: use @reporters/github when running in github actions PR-URL: https://github.com/nodejs/node/pull/49129 Refs: https://github.com/nodejs/node/issues/49120 Reviewed-By: Colin Ihrig Reviewed-By: Antoine du Hamel --- tools/test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index 545633451de97e..dafc22584bfdd8 100755 --- a/tools/test.py +++ b/tools/test.py @@ -316,6 +316,12 @@ def HasRun(self, output): sys.stdout.flush() class ActionsAnnotationProgressIndicator(DotsProgressIndicator): + def AboutToRun(self, case): + if not hasattr(case, 'additional_flags'): + case.additional_flags = [] + case.additional_flags.append('--test-reporter=./tools/github_reporter/index.js') + case.additional_flags.append('--test-reporter-destination=stdout') + def GetAnnotationInfo(self, test, output): traceback = output.stdout + output.stderr find_full_path = re.search(r' +at .*\(.*%s:([0-9]+):([0-9]+)' % test.file, traceback) @@ -601,7 +607,8 @@ def Run(self): result = self.RunCommand(self.GetCommand(), { "TEST_SERIAL_ID": "%d" % self.serial_id, "TEST_THREAD_ID": "%d" % self.thread_id, - "TEST_PARALLEL" : "%d" % self.parallel + "TEST_PARALLEL" : "%d" % self.parallel, + "GITHUB_STEP_SUMMARY": "", }) finally: # Tests can leave the tty in non-blocking mode. If the test runner