Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/regression/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def pytest_addoption(parser):
parser.addoption(
"--local-repository",
action="store",
default=None,
help="Location of the local repository of reference MFiles.",
)
23 changes: 20 additions & 3 deletions tests/regression/test_process_input_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def test_input_file(
opt_params_only: bool,
hide_model_logs,
cli_runner,
request,
):
"""Tests each input file in the 'input_files' directory.

Expand Down Expand Up @@ -327,9 +328,25 @@ def test_input_file(

scenario = RegressionTestScenario(new_input_file)

reference_mfile = tracked_regression_test_assets.get_reference_mfile(
scenario.scenario_name
)
local_repo = request.config.getoption("--local-repository")

if local_repo is None:
reference_mfile = tracked_regression_test_assets.get_reference_mfile(
scenario.scenario_name
)
else:
# Note that the MFILE must be present in the local repository with the exact
# naming pattern as the IN.DAT (including capitalisation, IN.DAT and MFILE.DAT
# must be capitals):
# - MY.IN.DAT -> MY.MFILE.DAT
# - MY_IN.DAT -> MY_MFILE.DAT
# - myIN.DAT -> myMFILE.DAT
# This naming convention is consistent with PROCESS but is inconsistent with the
# remote repoistory for legacy reasons (i.e. scenario_name does not follow

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# remote repoistory for legacy reasons (i.e. scenario_name does not follow
# remote repository for legacy reasons (i.e. scenario_name does not follow

# this convention).
reference_mfile = Path(
local_repo, input_file.name.replace("IN.DAT", "MFILE.DAT")
)

scenario.run(solver_name, cli_runner)

Expand Down
Loading