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

CWL Slurm memory test: simplify #5127

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/toil/test/cwl/cwlTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@ def test_slurm_node_memory(self) -> None:
"--outdir",
self.outDir,
os.path.join(self.rootDir, "src/toil/test/cwl/measure_default_memory.cwl"),
os.path.join(self.rootDir, "src/toil/test/cwl/empty.json"),
]
try:
log.debug("Start test workflow")
Expand All @@ -497,7 +496,7 @@ def test_slurm_node_memory(self) -> None:
else:
out = json.loads(output)
log.debug("Workflow output: %s", out)
memory_string = open(out["memory"]["location"][len("file://") :]).read()
memory_string = out["memory"]
log.debug("Observed memory: %s", memory_string)
result = int(memory_string)
# We should see more than the CWL default or the Toil default, assuming Slurm nodes of reasonable size (3 GiB).
Expand Down
29 changes: 9 additions & 20 deletions src/toil/test/cwl/measure_default_memory.cwl
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
cwlVersion: v1.2
class: Workflow

class: CommandLineTool
inputs: []

steps:
measure:
run:
class: CommandLineTool
inputs: []
baseCommand: ["bash", "-c", "ulimit -m"]
outputs:
memory: stdout
in: []
out:
# There's no good way to go back from a command output to a CWL value
# without bringing in a bunch of JS.
- id: memory

baseCommand: ["bash", "-c", "ulimit -m"]
stdout: memory.txt
outputs:
- id: memory
type: File
outputSource: measure/memory
memory:
type: string
outputBinding:
glob: memory.txt
loadContents: True
outputEval: $(self[0].contents)