Skip to content

Commit d12f976

Browse files
author
bogdang989
committed
Add tests for timelimit in workflow
1 parent 54af5a1 commit d12f976

File tree

5 files changed

+166
-0
lines changed

5 files changed

+166
-0
lines changed

conformance_tests.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2810,6 +2810,35 @@
28102810
doc: Test expression in time limit
28112811
tags: [ command_line_tool, timelimit, inline_javascript ]
28122812

2813+
- job: tests/empty.json
2814+
should_fail: true
2815+
tool: tests/timelimit-wf.cwl
2816+
label: timelimit_basic_wf
2817+
doc: Test that workflow fails when exceeding time limit
2818+
tags: [ workflow, timelimit ]
2819+
2820+
- job: tests/empty.json
2821+
should_fail: true
2822+
tool: tests/timelimit2-wf.cwl
2823+
label: timelimit_invalid_wf
2824+
doc: Test invalid time limit value workflow level
2825+
tags: [ workflow, timelimit ]
2826+
2827+
- job: tests/empty.json
2828+
output:
2829+
o: time passed
2830+
tool: tests/timelimit3-wf.cwl
2831+
label: timelimit_zero_unlimited_wf
2832+
doc: Test zero timelimit means no limit in workflow
2833+
tags: [ workflow, timelimit ]
2834+
2835+
- job: tests/empty.json
2836+
should_fail: true
2837+
tool: tests/timelimit4.cwl
2838+
label: timelimit_from_expression_wf
2839+
doc: Test expression in time limit in workflow
2840+
tags: [ workflow, timelimit, inline_javascript ]
2841+
28132842
- job: tests/empty.json
28142843
output: {}
28152844
tool: tests/networkaccess.cwl

tests/timelimit-wf.cwl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env cwl-runner
2+
class: Workflow
3+
cwlVersion: v1.1.0-dev1
4+
5+
requirements:
6+
TimeLimit:
7+
timelimit: 3
8+
9+
inputs:
10+
i:
11+
type: int?
12+
13+
outputs:
14+
o:
15+
type: string?
16+
outputSource: step1/o
17+
18+
steps:
19+
step1:
20+
in:
21+
i: i
22+
out: [o]
23+
run:
24+
class: CommandLineTool
25+
baseCommand: ["sleep", "10"]
26+
inputs:
27+
i:
28+
type: int?
29+
outputs:
30+
o:
31+
type: string?
32+
outputBinding:
33+
outputEval: "time passed"
34+

tests/timelimit2-wf.cwl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env cwl-runner
2+
class: Workflow
3+
cwlVersion: v1.1.0-dev1
4+
5+
requirements:
6+
TimeLimit:
7+
timelimit: -1
8+
9+
inputs:
10+
i:
11+
type: int?
12+
13+
outputs:
14+
o:
15+
type: string?
16+
outputSource: step1/o
17+
18+
steps:
19+
step1:
20+
in:
21+
i: i
22+
out: [o]
23+
run:
24+
class: CommandLineTool
25+
baseCommand: ["sleep", "10"]
26+
inputs:
27+
i:
28+
type: int?
29+
outputs:
30+
o:
31+
type: string?
32+
outputBinding:
33+
outputEval: "time passed"
34+

tests/timelimit3-wf.cwl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env cwl-runner
2+
class: Workflow
3+
cwlVersion: v1.1.0-dev1
4+
5+
requirements:
6+
TimeLimit:
7+
timelimit: 0
8+
9+
inputs:
10+
i:
11+
type: int?
12+
13+
outputs:
14+
o:
15+
type: string?
16+
outputSource: step1/o
17+
18+
steps:
19+
step1:
20+
in:
21+
i: i
22+
out: [o]
23+
run:
24+
class: CommandLineTool
25+
baseCommand: ["sleep", "10"]
26+
inputs:
27+
i:
28+
type: int?
29+
outputs:
30+
o:
31+
type: string?
32+
outputBinding:
33+
outputEval: "time passed"
34+

tests/timelimit4-wf.cwl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env cwl-runner
2+
class: Workflow
3+
cwlVersion: v1.1.0-dev1
4+
5+
requirements:
6+
TimeLimit:
7+
timelimit: $(1+2)
8+
InlineJavascriptRequirement: {}
9+
10+
inputs:
11+
i:
12+
type: int?
13+
14+
outputs:
15+
o:
16+
type: string?
17+
outputSource: step1/o
18+
19+
steps:
20+
step1:
21+
in:
22+
i: i
23+
out: [o]
24+
run:
25+
class: CommandLineTool
26+
baseCommand: ["sleep", "10"]
27+
inputs:
28+
i:
29+
type: int?
30+
outputs:
31+
o:
32+
type: string?
33+
outputBinding:
34+
outputEval: "time passed"
35+

0 commit comments

Comments
 (0)