Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fork repositories support for reporting regression tests #508

Merged
merged 15 commits into from
Nov 27, 2023
Merged
10 changes: 3 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,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 regression occurrence
tilk marked this conversation as resolved.
Show resolved Hide resolved
run: ./scripts/check_test_results.py

unit-test:
name: Run unit tests
Expand Down Expand Up @@ -102,7 +98,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")