Skip to content

Commit 485831b

Browse files
committed
fix for recent Toil
1 parent b796f2f commit 485831b

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

test/test_integration.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ def test_local_md5sum(self):
8888
)
8989

9090
# See https://ga4gh.github.io/workflow-execution-service-schemas/docs/#operation/GetRunLog
91-
@pytest.mark.skip("workflow_attachment is not part of WES spec for the log.request body")
91+
@pytest.mark.skip(
92+
"workflow_attachment is not part of WES spec for the log.request body"
93+
)
9294
def test_run_attachments(self):
9395
"""LOCAL md5sum cwl to the wes-service server, check for attachments."""
9496
outfile_path, run_id = self.run_md5sum(
@@ -257,21 +259,6 @@ def test_local_wdl(self):
257259
"Output file was not found: " + str(outfile_path),
258260
)
259261

260-
def test_dockstore_md5sum(self):
261-
# TODO: currently not working after update on Sept. 22, 2019
262-
# see: https://github.com/common-workflow-language/workflow-service/issues/73
263-
pass
264-
265-
def test_local_md5sum(self):
266-
# TODO: currently not working after update on Sept. 22, 2019
267-
# see: https://github.com/common-workflow-language/workflow-service/issues/73
268-
pass
269-
270-
def test_run_attachments(self):
271-
# TODO: currently not working after update on Sept. 22, 2019
272-
# see: https://github.com/common-workflow-language/workflow-service/issues/73
273-
pass
274-
275262

276263
@pytest.mark.skipif(
277264
not os.environ.get("ARVADOS_API_TOKEN"), reason="Arvados not configured"

wes_service/toil_wes.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def call_cmd(self, cmd, cwd):
121121
f.write(str(cmd))
122122
stdout = open(self.outfile, "w")
123123
stderr = open(self.errfile, "w")
124-
logging.info("Calling: " + " ".join(cmd))
124+
logging.info("Calling: %s, with outfile: %s and errfile: %s", (" ".join(cmd)), self.outfile, self.errfile)
125125
process = subprocess.Popen(
126126
cmd, stdout=stdout, stderr=stderr, close_fds=True, cwd=cwd
127127
)
@@ -267,18 +267,15 @@ def getstate(self):
267267
logging.info("Workflow " + self.run_id + ": INITIALIZING")
268268
return "INITIALIZING", -1
269269

270-
# TODO: Query with "toil status"
271270
completed = False
272271
with open(self.errfile) as f:
273272
for line in f:
274273
if "Traceback (most recent call last)" in line:
275274
logging.info("Workflow " + self.run_id + ": EXECUTOR_ERROR")
276275
open(self.staterrorfile, "a").close()
277276
return "EXECUTOR_ERROR", 255
278-
# run can complete successfully but fail to upload outputs to cloud buckets
279-
# so save the completed status and make sure there was no error elsewhere
280-
if "Finished toil run successfully." in line:
281-
completed = True
277+
if subprocess.run(["toil", "status", "--failIfNotComplete", self.jobstorefile]).returncode == 0:
278+
completed = True
282279
if completed:
283280
logging.info("Workflow " + self.run_id + ": COMPLETE")
284281
open(self.statcompletefile, "a").close()

0 commit comments

Comments
 (0)