Skip to content

Commit

Permalink
Add fork repositories support for reporting regression tests (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
makz00 committed Nov 27, 2023
1 parent 964065c commit bfc0445
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,8 @@ jobs:
. venv/bin/activate
scripts/run_tests.py -a regression
- name: Test Report
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: test/regression/cocotb/results.xml
check_name: cocotb test results
comment_mode: off
- name: Check for test failure
run: ./scripts/check_test_results.py

unit-test:
name: Run unit tests
Expand Down Expand Up @@ -131,7 +127,7 @@ jobs:
run: ./scripts/run_tests.py --verbose

- name: Check traces
run: ./scripts/run_tests.py -t -c 1 TestCore
run: ./scripts/run_tests.py -t -c 1 TestCore

lint:
name: Check code formatting and typing
Expand Down
22 changes: 22 additions & 0 deletions scripts/check_test_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python3

import sys
import os
import pathlib
import xml.etree.ElementTree as eT

FAILURE_TAG = "failure"
TOP_DIR = pathlib.Path(__file__).parent.parent
TEST_RESULTS_FILE = TOP_DIR.joinpath("test/regression/cocotb/results.xml")

if not os.path.exists(TEST_RESULTS_FILE):
print("File not found: ", TEST_RESULTS_FILE)
sys.exit(1)

tree = eT.parse(TEST_RESULTS_FILE)

if len(list(tree.iter(FAILURE_TAG))) > 0:
print("Some regression tests failed")
sys.exit(1)

print("All regression tests pass")

0 comments on commit bfc0445

Please sign in to comment.