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: #49129
Refs: #49120
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
MoLow authored and pull[bot] committed Nov 1, 2023
1 parent 511c891 commit 5e4f0e1
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 5e4f0e1

Please sign in to comment.