Fix cond comp artifacts path (#4200)

This commit is contained in:
Andrey Somsikov authored and GitHub committed 2021-02-08 11:18:27 +03:00
1 parent 785828d321
commit db065d525e
2 files changed
+10 -8

No files matched your search

+4 -3
View File
@@ -78,9 +78,10 @@ def pytest_generate_tests(metafunc):
if "marks" in test:
extra_args["marks"] = test["marks"]
params.append(pytest.param(Path(expand_env_vars(model_path)), **extra_args))
ids = ids + [model_path]
metafunc.parametrize("model", params, ids=ids)
test_id = model_path.replace('$', '').replace('{', '').replace('}', '')
params.append(pytest.param(test_id, Path(expand_env_vars(model_path)), **extra_args))
ids = ids + [test_id]
metafunc.parametrize("test_id, model", params, ids=ids)
@pytest.fixture(scope="session")
@@ -7,22 +7,23 @@
import glob
import os
import sys
from proc_utils import cmd_exec # pylint: disable=import-error
def test_cc_collect(model, sea_runtool, benchmark_app, collector_dir, artifacts):
def test_cc_collect(test_id, model, sea_runtool, benchmark_app, collector_dir, artifacts):
""" Test conditional compilation statistics collection
"""
out = artifacts / model.parent / model.stem
out = artifacts / test_id
# cleanup old data if any
prev_results = glob.glob(f"{out}.pid*.csv")
for path in prev_results:
os.remove(path)
# run use case
returncode, _ = cmd_exec(
returncode, output = cmd_exec(
[
"python",
sys.executable,
str(sea_runtool),
f"-o={out}",
"-f=stat",
@@ -35,7 +36,7 @@ def test_cc_collect(model, sea_runtool, benchmark_app, collector_dir, artifacts)
"-nireq=1",
]
)
assert returncode == 0, f"Command exited with non-zero status {returncode}"
assert returncode == 0, f"Command exited with non-zero status {returncode}:\n {output}"
assert (
len(glob.glob(f"{out}.pid*.csv")) == 1
), f'Multiple or none "{out}.pid*.csv" files'