Skip to content

Commit c220d1e

Browse files
committed
Add "--expected-fail" option to run_framework.py
1 parent 7e90d52 commit c220d1e

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
python -m pip install numba==0.54
2626
- name: Test
2727
run: |
28-
python run_framework.py -f numba -r 1 --ignore-errors=0
28+
python run_framework.py -f numba -r 1 --ignore-errors=0 --expected-fail=azimint_hist,contour_integral,correlation,covariance,durbin,mlp

run_framework.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,21 @@ def run_benchmark(benchname, fname, preset, validate, repeat, timeout,
5757
type=util.str2bool,
5858
nargs="?",
5959
default=False)
60+
parser.add_argument("--expected-fail",
61+
type=str,
62+
nargs="?",
63+
default="")
6064
args = vars(parser.parse_args())
6165

6266
parent_folder = pathlib.Path(__file__).parent.absolute()
6367
bench_dir = parent_folder.joinpath("bench_info")
6468
pathlist = pathlib.Path(bench_dir).rglob('*.json')
6569
benchnames = [os.path.basename(path)[:-5] for path in pathlist]
6670
benchnames.sort()
71+
72+
xfail = set(filter(None, args["expected_fail"].split(',')))
6773
failed = []
74+
xpassed = []
6875
for benchname in benchnames:
6976
p = Process(target=run_benchmark,
7077
args=(benchname, args["framework"], args["preset"],
@@ -74,10 +81,22 @@ def run_benchmark(benchname, fname, preset, validate, repeat, timeout,
7481
p.start()
7582
p.join()
7683
exit_code = p.exitcode
77-
if exit_code != 0:
78-
failed.append(benchname)
84+
if benchname in xfail:
85+
if exit_code == 0:
86+
xpassed.append(benchname)
87+
else:
88+
if exit_code != 0:
89+
failed.append(benchname)
7990

8091
if len(failed) != 0:
8192
print(f"Failed: {len(failed)} out of {len(benchnames)}")
8293
for bench in failed:
8394
print(bench)
95+
96+
if len(xpassed) != 0:
97+
print(f"Unexpectedly passed: {len(xpassed)} out of {len(benchnames)}")
98+
for bench in xpassed:
99+
print(bench)
100+
101+
if len(failed) != 0 or len(xpassed) != 0:
102+
sys.exit(1)

0 commit comments

Comments
 (0)