Skip to content

Commit

Permalink
Append driver name to done file (ufs-community#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
maddenp-noaa authored Apr 9, 2024
1 parent 1c1b052 commit c2f139c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/uwtools/drivers/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ def _write_runscript(self, path: Path, envvars: Dict[str, str]) -> None:
rs = self._runscript(
envcmds=self._driver_config.get("execution", {}).get("envcmds", []),
envvars=envvars,
execution=["time %s" % self._runcmd, "test $? -eq 0 && touch %s/done" % self._rundir],
execution=[
"time %s" % self._runcmd,
"test $? -eq 0 && touch %s/done.%s" % (self._rundir, self._driver_name),
],
scheduler=self._scheduler if self._batch else None,
)
with open(path, "w", encoding="utf-8") as f:
Expand Down
2 changes: 1 addition & 1 deletion src/uwtools/tests/drivers/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def test_Driver__write_runscript(driverobj, tmp_path):
export BAZ=qux
time foo bar baz qux
test $? -eq 0 && touch /path/to/2024032218/run/done
test $? -eq 0 && touch /path/to/2024032218/run/done.concrete
"""
with open(path, "r", encoding="utf-8") as f:
actual = f.read()
Expand Down

0 comments on commit c2f139c

Please sign in to comment.