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 <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Moshe Atlow 2023-08-13 09:46:38 +03:00 committed by Node.js GitHub Bot
parent 8972f9beed
commit 0d6cdb25fe

View File

@ -316,6 +316,12 @@ class DotsProgressIndicator(SimpleProgressIndicator):
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 @@ class TestCase(object):
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