-
Notifications
You must be signed in to change notification settings - Fork 3
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
Run executable from task dir #124
Conversation
Codecov Report
@@ Coverage Diff @@
## master #124 +/- ##
==========================================
- Coverage 88.46% 88.44% -0.02%
==========================================
Files 26 27 +1
Lines 1387 1385 -2
==========================================
- Hits 1227 1225 -2
Misses 160 160
|
Currently, the CABLE executable is run from the current working directory instead of the task directory by using the absolute path to the executable. However, we should be running the executable from the task directory (otherwise CABLE will complain it cannot find the soil and PFT namelist files). This was a bug that was introduced in the #99. This change makes it so we change into the task directory before running the CABLE executable. Fixes #123
a9e731b
to
2d1de0c
Compare
Integration testsTest five site experiment:
CABLE standard output:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a small question but I'm happy for this to go in either way.
tests/test_task.py
Outdated
@@ -295,7 +295,7 @@ def test_run_cable(): | |||
|
|||
# Success case: run CABLE executable in subprocess | |||
task.run_cable() | |||
assert f"{exe_path} {nml_path}" in mock_subprocess.commands | |||
assert f"./{exe_path.name} {nml_path.name}" in mock_subprocess.commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm suddenly wondering if exe_path
and nml_path
really need to exist? Could this assert be: assert f"./{internal.CABLE_EXE} {internal.CABLE_nml} in mock_subprocess.commands
and remove the definition of exe_path
and nml_path
.
That's a detail, I'm happy to put things in as is. Just mentioning it as I like things as simple as possible when we think of it.
Pull request: #124 Co-authored-by: Claire Carouge <[email protected]>
Currently, the CABLE executable is run from the current working directory instead of the task directory by using the absolute path to the executable. However, we should be running the executable from the task directory (otherwise CABLE will complain it cannot find the soil and PFT namelist files). This was a bug that was introduced in #99.
This change makes it so we change into the task directory before running the CABLE executable.
Fixes #123