From e4fb08af20263d417bbc3b100ce51c60c7229320 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 28 Mar 2023 08:57:28 +0200 Subject: [PATCH] Update test suite branch --- .github/workflows/petab_testsuite.yml | 2 +- tests/petab-test-suite/conftest.py | 2 +- tests/petab-test-suite/test_petab_test_suite.py | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/petab_testsuite.yml b/.github/workflows/petab_testsuite.yml index 0cf36659..2efc1e34 100644 --- a/.github/workflows/petab_testsuite.yml +++ b/.github/workflows/petab_testsuite.yml @@ -63,7 +63,7 @@ jobs: PETAB_TEST_URL: https://github.com/PEtab-dev/petab_test_suite.git run: | cd $PARPE_BASE/ \ - && git clone --depth 1 --branch develop $PETAB_TEST_URL \ + && git clone --depth 1 --branch main $PETAB_TEST_URL \ && $PARPE_BASE/misc/run_in_venv.sh $PARPE_BASE/build/venv \ pip3 install -e petab_test_suite diff --git a/tests/petab-test-suite/conftest.py b/tests/petab-test-suite/conftest.py index 35903845..15da29cf 100644 --- a/tests/petab-test-suite/conftest.py +++ b/tests/petab-test-suite/conftest.py @@ -45,6 +45,6 @@ def pytest_generate_tests(metafunc): test_numbers = parse_selection(cases) else: # Run all tests - test_numbers = petabtests.get_cases('sbml') + test_numbers = petabtests.get_cases('sbml', version="v1.0.0") metafunc.parametrize("case", test_numbers) diff --git a/tests/petab-test-suite/test_petab_test_suite.py b/tests/petab-test-suite/test_petab_test_suite.py index df04831b..f6f67ffe 100755 --- a/tests/petab-test-suite/test_petab_test_suite.py +++ b/tests/petab-test-suite/test_petab_test_suite.py @@ -53,6 +53,8 @@ def check_run(cmd: List[str]) -> subprocess.CompletedProcess: def _test_case(case: Union[int, str]) -> None: """Run a single PEtab test suite case""" + model_type = 'sbml' + version = "v1.0.0" case = petabtests.test_id_str(case) logger.debug(f"Case {case}") @@ -64,7 +66,8 @@ def _test_case(case: Union[int, str]) -> None: if case in ['0012', '0018']: raise NotImplementedError(case) - case_dir = petabtests.CASES_DIR / case + case_dir = petabtests.get_case_dir(case, model_type, version) + yaml_file = case_dir / petabtests.problem_yaml_name(case) yaml_file = case_dir / petabtests.problem_yaml_name(case) test_dir = Path(__file__).parent.absolute() parpe_dir = test_dir.parents[1] @@ -111,7 +114,7 @@ def _test_case(case: Union[int, str]) -> None: g = re.search(r'Likelihood: (\d+\.\d+)', ret.stdout)[0] llh_actual = - float(g.split(' ')[1]) print("Actual llh:", llh_actual) - solution = petabtests.load_solution(case, 'sbml') + solution = petabtests.load_solution(case, model_type, version=version) gt_llh = solution[petabtests.LLH] assert llh_actual == pytest.approx(gt_llh, @@ -127,7 +130,7 @@ def run() -> None: n_success = 0 n_skipped = 0 - all_cases = list(petabtests.get_cases('sbml')) + all_cases = list(petabtests.get_cases('sbml', version="v1.0.0")) for case in all_cases: try: test_case(case)