From c2f139c962e1fd12bbaf081f0e1f69395d6501ec Mon Sep 17 00:00:00 2001 From: Paul Madden <136389411+maddenp-noaa@users.noreply.github.com> Date: Tue, 9 Apr 2024 11:02:55 -0600 Subject: [PATCH] Append driver name to done file (#456) --- src/uwtools/drivers/driver.py | 5 ++++- src/uwtools/tests/drivers/test_driver.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/uwtools/drivers/driver.py b/src/uwtools/drivers/driver.py index 3c1249c70..54857982e 100644 --- a/src/uwtools/drivers/driver.py +++ b/src/uwtools/drivers/driver.py @@ -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: diff --git a/src/uwtools/tests/drivers/test_driver.py b/src/uwtools/tests/drivers/test_driver.py index 3522e3e79..dbc095a4e 100644 --- a/src/uwtools/tests/drivers/test_driver.py +++ b/src/uwtools/tests/drivers/test_driver.py @@ -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()