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

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zrr1999 committed Jul 13, 2023
1 parent aad2275 commit a9619ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions tests/extract_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
pattern = r'File "?(.*?)"?, line (\d+),.*\n(.*?)\n(.*?)$'
for match in re.finditer(pattern, error_msg, re.MULTILINE):
file = match.group(1)
if not file.startswith("/"):
file = f"tests/{file}"
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}"
print(output)
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}"
print(output)
8 changes: 4 additions & 4 deletions tests/run_all.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# 遍历目录下的所有 Python 文件
# 遍历目录下的所有 python 文件
export PYTHONPATH=$PYTHONPATH:../
export STRICT_MODE=1

failed_tests=()

for file in ./test_*.py; do
# 检查文件是否为 Python 文件
# 检查文件是否为 python 文件
if [ -f "$file" ]; then
if [[ -n "$GITHUB_ACTIONS" ]]; then
echo ::group::Running: PYTHONPATH=$PYTHONPATH " STRICT_MODE=1 python " $file
Expand All @@ -19,9 +19,9 @@ for file in ./test_*.py; do
echo "run $file failed"
failed_tests+=("$file")
if [[ -n "$GITHUB_ACTIONS" ]]; then
echo $python_output | python ./extract_errors.py
echo -e "$python_output" | python ./extract_errors.py
fi
echo $python_output
echo -e "$python_output"
fi
if [[ -n "$GITHUB_ACTIONS" ]]; then
echo "::endgroup::"
Expand Down

0 comments on commit a9619ee

Please sign in to comment.