Skip to content

Commit fe37ffb

Browse files
author
bogdang989
committed
Update timelimit tests with workflow and expression tool tests
1 parent d12f976 commit fe37ffb

10 files changed

+52
-18
lines changed

conformance_tests.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2810,18 +2810,27 @@
28102810
doc: Test expression in time limit
28112811
tags: [ command_line_tool, timelimit, inline_javascript ]
28122812

2813+
- job: tests/empty.json
2814+
output:
2815+
status: Done
2816+
tool: tests/timelimit5.cwl
2817+
label: timelimit_expressiontool
2818+
doc: Test timelimit in expressiontool is ignored
2819+
tags: [ expression_tool, timelimit, inline_javascript ]
2820+
28132821
- job: tests/empty.json
28142822
should_fail: true
28152823
tool: tests/timelimit-wf.cwl
28162824
label: timelimit_basic_wf
2817-
doc: Test that workflow fails when exceeding time limit
2825+
doc: Test that tool in workflow fails when exceeding time limit
28182826
tags: [ workflow, timelimit ]
28192827

28202828
- job: tests/empty.json
2821-
should_fail: true
2829+
output:
2830+
o: time passed
28222831
tool: tests/timelimit2-wf.cwl
28232832
label: timelimit_invalid_wf
2824-
doc: Test invalid time limit value workflow level
2833+
doc: Test workflow level time limit propagation
28252834
tags: [ workflow, timelimit ]
28262835

28272836
- job: tests/empty.json
@@ -2834,7 +2843,7 @@
28342843

28352844
- job: tests/empty.json
28362845
should_fail: true
2837-
tool: tests/timelimit4.cwl
2846+
tool: tests/timelimit4-wf.cwl
28382847
label: timelimit_from_expression_wf
28392848
doc: Test expression in time limit in workflow
28402849
tags: [ workflow, timelimit, inline_javascript ]

tests/timelimit-wf.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class: Workflow
33
cwlVersion: v1.1.0-dev1
44

55
requirements:
6-
TimeLimit:
6+
ToolTimeLimit:
77
timelimit: 3
88

99
inputs:

tests/timelimit.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ cwlVersion: v1.1.0-dev1
33
inputs: []
44
outputs: []
55
requirements:
6-
TimeLimit:
6+
ToolTimeLimit:
77
timelimit: 3
88
baseCommand: [sleep, "15"]

tests/timelimit2-wf.cwl

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ class: Workflow
33
cwlVersion: v1.1.0-dev1
44

55
requirements:
6-
TimeLimit:
7-
timelimit: -1
6+
ToolTimeLimit:
7+
timelimit: 5
88

99
inputs:
1010
i:
11-
type: int?
11+
type: string?
1212

1313
outputs:
1414
o:
1515
type: string?
16-
outputSource: step1/o
16+
outputSource: step2/o
1717

1818
steps:
1919
step1:
@@ -22,13 +22,28 @@ steps:
2222
out: [o]
2323
run:
2424
class: CommandLineTool
25-
baseCommand: ["sleep", "10"]
25+
baseCommand: ["sleep", "3"]
26+
inputs:
27+
i:
28+
type: string?
29+
outputs:
30+
o:
31+
type: string?
32+
outputBinding:
33+
outputEval: "time passed"
34+
step2:
35+
in:
36+
i: step1/o
37+
out: [o]
38+
run:
39+
class: CommandLineTool
40+
baseCommand: ["sleep", "3"]
2641
inputs:
2742
i:
28-
type: int?
43+
type: string?
2944
outputs:
3045
o:
3146
type: string?
3247
outputBinding:
3348
outputEval: "time passed"
34-
49+

tests/timelimit2.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ cwlVersion: v1.1.0-dev1
33
inputs: []
44
outputs: []
55
requirements:
6-
TimeLimit:
6+
ToolTimeLimit:
77
timelimit: -1
88
baseCommand: [sleep, "15"]

tests/timelimit3-wf.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class: Workflow
33
cwlVersion: v1.1.0-dev1
44

55
requirements:
6-
TimeLimit:
6+
ToolTimeLimit:
77
timelimit: 0
88

99
inputs:

tests/timelimit3.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ cwlVersion: v1.1.0-dev1
33
inputs: []
44
outputs: []
55
requirements:
6-
TimeLimit:
6+
ToolTimeLimit:
77
timelimit: 0
88
baseCommand: [sleep, "15"]

tests/timelimit4-wf.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class: Workflow
33
cwlVersion: v1.1.0-dev1
44

55
requirements:
6-
TimeLimit:
6+
ToolTimeLimit:
77
timelimit: $(1+2)
88
InlineJavascriptRequirement: {}
99

tests/timelimit4.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ inputs: []
44
outputs: []
55
requirements:
66
InlineJavascriptRequirement: {}
7-
TimeLimit:
7+
ToolTimeLimit:
88
timelimit: $(1+2)
99
baseCommand: [sleep, "15"]

tests/timelimit5.cwl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class: ExpressionTool
2+
cwlVersion: v1.1.0-dev1
3+
inputs: []
4+
outputs:
5+
status: string
6+
requirements:
7+
ToolTimeLimit:
8+
timelimit: 3
9+
InlineJavascriptRequirement: {}
10+
expression: "${\n function sleep(milliseconds) {\n var start = new Date().getTime();\n for (var i = 0; i < 1e7; i++) {\n if ((new Date().getTime() - start) > milliseconds){\n break;\n }\n }\n };\n sleep(5000);\n return {\"status\": \"Done\"}\n}"

0 commit comments

Comments
 (0)