Skip to content

Commit ef67193

Browse files
committed
Squashed 'cwltool/schemas/' changes from 3e1b02c..0c275b4
0c275b4 clarify that outputBinding must not be set c30b79f finish restoring allowable types for parameters 06c9ba7 Merge pull request #230 from common-workflow-language/stderr-out-types cbd7bc2 only allow use of stderr/stdout shortcuts as types for the Outputs. Better place the docs 0ba703d jsonldPredicate did it! a5a7516 nope, use an enum instead 24a611d use long ids? 52f6411 extend doc to stderr psuedotype 9d0fbe0 initial stdout & stderr shortcut support 392be2f fixing site build? 57a5bc8 Fix last test using "args" 3cc79d2 Port draft-3 changes to command line generation tests to draft-4. f2a18c3 Add missing args.py used by draft-3 tests. ac17f5d Port draft-2 changes to command line generation tests to draft-3. ddf417b Command line generation tests now work by executing a small script that copies the command line to the output. Allows cwl-runner implementations to drop the --conformance-test code path. c4cecad Merge pull request #228 from common-workflow-language/scoped-ref-and-typedsl d1d53b3 Merge pull request #227 from common-workflow-language/stderr 0b987d3 add test 71e9b3d add stderr object 347c28e Merge pull request #212 from common-workflow-language/cwl-runner-interface 28f64f0 clarify description d791500 add output stanza, fix syntax ee0bea3 add descriptions 04dfbf0 toolfile is optional b1e740e bind and order the tool and jobfiles 81bd8de description c7a2bf1 move to a better location 979453a initial description of cwl-runner interface git-subtree-dir: cwltool/schemas git-subtree-split: 0c275b4
1 parent dba242f commit ef67193

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+713
-241
lines changed

draft-2/conformance_test_draft-2.yaml

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,52 @@
1-
- args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3', draft-2/rabix/tests/test-files/chr20.fa,
2-
draft-2/rabix/tests/test-files/example_human_Illumina.pe_1.fastq, draft-2/rabix/tests/test-files/example_human_Illumina.pe_2.fastq]
1+
- args:
32
job: draft-2/bwa-mem-job.json
4-
stdout: output.sam
53
tool: draft-2/bwa-mem-tool.cwl
4+
output:
5+
args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3',
6+
chr20.fa,
7+
example_human_Illumina.pe_1.fastq,
8+
example_human_Illumina.pe_2.fastq]
69
doc: General test of command line generation
710

8-
- args: [bwa, mem, draft-2/rabix/tests/test-files/chr20.fa,
9-
"-XXX",
10-
"-YYY", draft-2/rabix/tests/test-files/example_human_Illumina.pe_1.fastq,
11-
"-YYY", draft-2/rabix/tests/test-files/example_human_Illumina.pe_2.fastq]
11+
- output:
12+
args: [bwa, mem, chr20.fa,
13+
"-XXX",
14+
"-YYY", example_human_Illumina.pe_1.fastq,
15+
"-YYY", example_human_Illumina.pe_2.fastq]
1216
job: draft-2/bwa-mem-job.json
1317
tool: draft-2/binding-test.cwl
1418
doc: Test nested prefixes with arrays
1519

16-
- args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length,
20+
- output:
21+
args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length,
1722
'20', stage2, map1, --max-seq-length, '20', --min-seq-length, '10', --seed-length,
1823
'16', map2, --max-seed-hits, '-1', --max-seq-length, '20', --min-seq-length, '10']
1924
job: draft-2/tmap-job.json
20-
stdin: draft-2/reads.fastq
21-
stdout: output.sam
2225
tool: draft-2/tmap-tool.cwl
23-
doc: Test nested command line bindings and stdin/stdout redirection
26+
doc: Test nested command line bindings
2427

25-
- args: [cat, draft-2/hello.txt]
28+
- output:
29+
args: [cat, hello.txt]
2630
job: draft-2/cat-job.json
27-
tool: draft-2/cat1-tool.cwl
31+
tool: draft-2/cat1-testcli.cwl
2832
doc: Test command line with optional input (missing)
2933

30-
- args: [cat, -n, draft-2/hello.txt]
34+
- output:
35+
args: [cat, -n, hello.txt]
3136
job: draft-2/cat-n-job.json
32-
tool: draft-2/cat1-tool.cwl
37+
tool: draft-2/cat1-testcli.cwl
3338
doc: Test command line with optional input (provided)
3439

35-
- args: [cat]
36-
job: draft-2/cat-job.json
37-
stdin: draft-2/hello.txt
38-
tool: draft-2/cat2-tool.cwl
39-
doc: Test command line with stdin redirection
40-
41-
- args: [cat, draft-2/hello.txt]
42-
job: draft-2/cat-job.json
43-
stdout: output.txt
44-
tool: draft-2/cat3-tool.cwl
45-
doc: Test command line with stdout redirection
46-
47-
- args: [cat]
48-
job: draft-2/cat-job.json
49-
stdin: draft-2/hello.txt
50-
stdout: output.txt
51-
tool: draft-2/cat4-tool.cwl
52-
doc: Test command line with stdin and stdout redirection
53-
54-
- args: [cat, foo.txt]
55-
createfiles: {foo.txt: 'The file is draft-2/hello.txt
56-
57-
'}
40+
- output:
41+
"foo": {
42+
"checksum": "sha1$63da67422622fbf9251a046d7a34b7ea0fd4fead",
43+
"class": "File",
44+
"path": "foo.txt",
45+
"size": 22
46+
}
5847
job: draft-2/cat-job.json
5948
tool: draft-2/template-tool.cwl
60-
doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig features
49+
doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig feature
6150

6251
- job: draft-2/cat-job.json
6352
output:

draft-2/draft-2/args.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env python
2+
import sys
3+
import json
4+
import os
5+
args = [os.path.basename(a) for a in sys.argv[1:]]
6+
with open("cwl.output.json", "w") as f:
7+
json.dump({"args": args}, f)

draft-2/draft-2/binding-test.cwl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ inputs:
1414
inputBinding: { prefix: "-YYY" }
1515
inputBinding: { position: 3, prefix: "-XXX" }
1616

17+
- id: "#args.py"
18+
type: File
19+
default:
20+
class: File
21+
path: args.py
22+
inputBinding:
23+
position: -1
24+
1725
outputs: []
1826

19-
baseCommand: ["bwa", "mem"]
27+
baseCommand: python
28+
arguments: ["bwa", "mem"]

draft-2/draft-2/bwa-mem-job.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"reference": {
33
"class": "File",
4-
"path": "rabix/tests/test-files/chr20.fa",
4+
"path": "chr20.fa",
55
"size": 123,
66
"checksum": "sha1$hash"
77
},
88
"reads": [
99
{
1010
"class": "File",
11-
"path": "rabix/tests/test-files/example_human_Illumina.pe_1.fastq"
11+
"path": "example_human_Illumina.pe_1.fastq"
1212
},
1313
{
1414
"class": "File",
15-
"path": "rabix/tests/test-files/example_human_Illumina.pe_2.fastq"
15+
"path": "example_human_Illumina.pe_2.fastq"
1616
}
1717
],
1818
"min_std_max_min": [

draft-2/draft-2/bwa-mem-tool.cwl

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ class: CommandLineTool
44
requirements:
55
- import: node-engine.cwl
66

7-
hints:
8-
- class: DockerRequirement
9-
dockerPull: images.sbgenomics.com/rabix/bwa
10-
dockerImageId: 9d3b9b0359cf
11-
127
inputs:
138
- id: "#reference"
149
type: File
@@ -31,14 +26,28 @@ inputs:
3126
prefix: "-I"
3227
itemSeparator: ","
3328

29+
- id: "#args.py"
30+
type: File
31+
default:
32+
class: File
33+
path: args.py
34+
inputBinding:
35+
position: -1
36+
3437
outputs:
3538
- id: "#sam"
36-
type: "File"
39+
type: ["null", "File"]
3740
outputBinding: { "glob": "output.sam" }
41+
- id: "#args"
42+
type:
43+
type: array
44+
items: string
3845

39-
baseCommand: ["bwa", "mem"]
46+
baseCommand: python
4047

4148
arguments:
49+
- "bwa"
50+
- "mem"
4251
- valueFrom:
4352
engine: "node-engine.cwl"
4453
script: "$job.allocatedResources.cpu"

draft-2/draft-2/cat1-testcli.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+
{
3+
"class": "CommandLineTool",
4+
"description": "Print the contents of a file to stdout using 'cat' running in a docker container.",
5+
"inputs": [
6+
{
7+
"id": "#file1",
8+
"type": "File",
9+
"inputBinding": {"position": 1}
10+
},
11+
{
12+
"id": "#numbering",
13+
"type": ["null", "boolean"],
14+
"inputBinding": {
15+
"position": 0,
16+
"prefix": "-n"
17+
}
18+
},
19+
{
20+
id: "#args.py",
21+
type: File,
22+
default: {
23+
class: File,
24+
path: args.py
25+
},
26+
inputBinding: {
27+
position: -1
28+
}
29+
}
30+
],
31+
"outputs": [],
32+
"baseCommand": "python",
33+
"arguments": ["cat"]
34+
}

draft-2/draft-2/cat2-tool.cwl

Lines changed: 0 additions & 23 deletions
This file was deleted.

draft-2/draft-2/chr20.fa

Whitespace-only changes.

draft-2/draft-2/example_human_Illumina.pe_1.fastq

Whitespace-only changes.

draft-2/draft-2/example_human_Illumina.pe_2.fastq

Whitespace-only changes.

draft-2/draft-2/reads.fastq

Whitespace-only changes.

draft-2/draft-2/template-tool.cwl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ requirements:
1717
- filename: foo.txt
1818
fileContent:
1919
engine: "#js"
20-
script: 't("The file is <%= $job.file1.path %>\n")'
20+
script: >
21+
t("The file is <%= $job.file1.path.split('/').slice(-1)[0] %>\n")
2122
inputs:
2223
- id: "#file1"
2324
type: File
24-
outputs: []
25+
outputs:
26+
- id: "#foo"
27+
type: File
28+
outputBinding:
29+
glob: foo.txt
2530
baseCommand: ["cat", "foo.txt"]

draft-2/draft-2/tmap-tool.cwl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,26 @@
1616
"type": "array",
1717
"items": "Stage"
1818
}
19+
},
20+
{
21+
id: "#args.py",
22+
type: File,
23+
default: {
24+
class: File,
25+
path: args.py
26+
},
27+
inputBinding: {
28+
position: -1
1929
}
30+
}
2031
],
2132
"outputs": [
2233
{
2334
"id": "#sam",
2435
"outputBinding": {
2536
"glob": "output.sam"
2637
},
27-
"type": "File"
38+
"type": ["null", "File"]
2839
}
2940
],
3041
"requirements": [
@@ -233,10 +244,6 @@
233244
]
234245
}
235246
]}],
236-
"baseCommand": ["tmap", "mapall"],
237-
"stdin": {
238-
"engine": "cwl:JsonPointer",
239-
"script": "job/reads/path"
240-
},
241-
"stdout": "output.sam"
247+
"baseCommand": "python",
248+
"arguments": ["tmap", "mapall"]
242249
}

draft-3/conformance_test_draft-3.yaml

Lines changed: 29 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,51 @@
1-
- args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3', draft-3/rabix/tests/test-files/chr20.fa,
2-
draft-3/rabix/tests/test-files/example_human_Illumina.pe_1.fastq, draft-3/rabix/tests/test-files/example_human_Illumina.pe_2.fastq]
3-
job: draft-3/bwa-mem-job.json
4-
stdout: output.sam
1+
- job: draft-3/bwa-mem-job.json
52
tool: draft-3/bwa-mem-tool.cwl
3+
output:
4+
args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3',
5+
chr20.fa,
6+
example_human_Illumina.pe_1.fastq,
7+
example_human_Illumina.pe_2.fastq]
68
doc: General test of command line generation
79

8-
- args: [bwa, mem, draft-3/rabix/tests/test-files/chr20.fa,
9-
"-XXX",
10-
"-YYY", draft-3/rabix/tests/test-files/example_human_Illumina.pe_1.fastq,
11-
"-YYY", draft-3/rabix/tests/test-files/example_human_Illumina.pe_2.fastq]
10+
- output:
11+
args: [bwa, mem, chr20.fa,
12+
"-XXX",
13+
"-YYY", example_human_Illumina.pe_1.fastq,
14+
"-YYY", example_human_Illumina.pe_2.fastq]
1215
job: draft-3/bwa-mem-job.json
1316
tool: draft-3/binding-test.cwl
1417
doc: Test nested prefixes with arrays
1518

16-
- args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length,
19+
- output:
20+
args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length,
1721
'20', stage2, map1, --max-seq-length, '20', --min-seq-length, '10', --seed-length,
1822
'16', map2, --max-seed-hits, '-1', --max-seq-length, '20', --min-seq-length, '10']
1923
job: draft-3/tmap-job.json
20-
stdin: draft-3/reads.fastq
21-
stdout: output.sam
2224
tool: draft-3/tmap-tool.cwl
23-
doc: Test nested command line bindings and stdin/stdout redirection
25+
doc: Test nested command line bindings
2426

25-
- args: [cat, draft-3/hello.txt]
27+
- output:
28+
args: [cat, hello.txt]
2629
job: draft-3/cat-job.json
27-
tool: draft-3/cat1-tool.cwl
30+
tool: draft-3/cat1-testcli.cwl
2831
doc: Test command line with optional input (missing)
2932

30-
- args: [cat, -n, draft-3/hello.txt]
33+
- output:
34+
args: [cat, -n, hello.txt]
3135
job: draft-3/cat-n-job.json
32-
tool: draft-3/cat1-tool.cwl
36+
tool: draft-3/cat1-testcli.cwl
3337
doc: Test command line with optional input (provided)
3438

35-
- args: [cat]
36-
job: draft-3/cat-job.json
37-
stdin: draft-3/hello.txt
38-
tool: draft-3/cat2-tool.cwl
39-
doc: Test command line with stdin redirection
40-
41-
- args: [cat, draft-3/hello.txt]
42-
job: draft-3/cat-job.json
43-
stdout: output.txt
44-
tool: draft-3/cat3-tool.cwl
45-
doc: Test command line with stdout redirection
46-
47-
- args: [cat]
48-
job: draft-3/cat-job.json
49-
stdin: draft-3/hello.txt
50-
stdout: output.txt
51-
tool: draft-3/cat4-tool.cwl
52-
doc: Test command line with stdin and stdout redirection
53-
54-
- args: [cat, foo.txt]
55-
createfiles: {foo.txt: 'The file is draft-3/hello.txt
56-
57-
'}
39+
- output:
40+
"foo": {
41+
"checksum": "sha1$63da67422622fbf9251a046d7a34b7ea0fd4fead",
42+
"class": "File",
43+
"path": "foo.txt",
44+
"size": 22
45+
}
5846
job: draft-3/cat-job.json
5947
tool: draft-3/template-tool.cwl
60-
doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig features
48+
doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig feature
6149

6250
- job: draft-3/cat-job.json
6351
output:
@@ -504,7 +492,7 @@
504492
doc: |
505493
Test parameter evaluation, with support for JS expressions
506494
507-
- args: [cat, draft-3/hello.txt]
495+
- output: {}
508496
job: draft-3/cat-job.json
509497
tool: draft-3/metadata.cwl
510498
doc: Test metadata

0 commit comments

Comments
 (0)