Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix error info
Browse files Browse the repository at this point in the history
  • Loading branch information
zrr1999 committed Jul 17, 2023
1 parent 2cfa434 commit 73af75f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/extract_errors.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import re
import sys

error_msg = sys.stdin.read()
runtime_error_msg = sys.stdin.read()

pattern = r'File "?(.*?)"?, line (\d+),.*\n(.*?)\n(.*?)$'
for match in re.finditer(pattern, error_msg, re.MULTILINE):
for match in re.finditer(pattern, runtime_error_msg, re.MULTILINE):
file = match.group(1)
if file.startswith("./"):
file = f"tests/{file[2:]}"
line = match.group(2)
error_info = match.group(4)
# error_info = match.group(3) + '\n' + match.group(4)
output = f"::error file={file},line={line}::{error_info}"
output = f"::error file={file},line={line}::Error"
print(output)

0 comments on commit 73af75f

Please sign in to comment.