Skip to content

Commit

Permalink
tools: use @reporters/github when running in github actions
Browse files Browse the repository at this point in the history
PR-URL: nodejs#49129
Refs: nodejs#49120
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
MoLow authored and RafaelGSS committed Aug 15, 2023
1 parent f43e5e1 commit 9b8f69e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9b8f69e

Please sign in to comment.