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

Remove general config test for exe paths #29

Closed
jo-basevi opened this issue Jul 3, 2024 · 4 comments · Fixed by #30
Closed

Remove general config test for exe paths #29

jo-basevi opened this issue Jul 3, 2024 · 4 comments · Fixed by #30

Comments

@jo-basevi
Copy link
Collaborator

In the eventual next release of payu, model executables can be set using modules. The current QA config tests check for absolute paths - and also that the exe paths are in the manifest:

def test_absolute_exe_path(self, config):
assert (
"exe" not in config or Path(config["exe"]).is_absolute()
), f"Executable for model should be an absolute path: {config['exe']}"
def test_absolute_submodel_exe_path(self, config):
for model in config.get("submodels", []):
if "exe" not in model:
# Allow models such as couplers that have no executable
if "ncpus" in model and model["ncpus"] != 0:
pytest.fail(f"No executable for submodel {model['name']}")
continue
assert Path(model["exe"]).is_absolute(), (
f"Executable for {model['name']} submodel should be "
+ f"an absolute path: {config['exe']}"
)
def test_exe_paths_in_manifest(self, config, exe_manifest_fullpaths):
if "exe" in config:
assert config["exe"] in exe_manifest_fullpaths, (
"Model executable path should be in Manifest file "
+ f"(e.g. manifests/exe.yaml): {config['exe']}"
)
def test_sub_model_exe_paths_in_manifest(self, config, exe_manifest_fullpaths):
for model in config.get("submodels", []):
if "exe" in model:
assert model["exe"] in exe_manifest_fullpaths, (
f"Submodel {model['name']} executable path should be in "
+ f"Manifest file (e.g. manifests/exe.yaml): {config['exe']}"
)

These tests will either need to be removed or updated

@jo-basevi
Copy link
Collaborator Author

Note relevant issue here for updating these tests: #18

@aidanheerdegen
Copy link
Member

We're specify the versions of tests we use right? So we could make this change without need for backwards compatibility?

@jo-basevi
Copy link
Collaborator Author

Yes, we specify the version in the <model>-configs repository. So we should only now test that exe paths are only set using modules?

@aidanheerdegen
Copy link
Member

So we should only now test that exe paths are only set using modules?

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants