Skip to content

Commit 5551e59

Browse files
committed
Test for outputEval on a record type itself, not its fields
1 parent 0a4c51c commit 5551e59

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed

conformance_tests.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,3 +3484,33 @@
34843484
tool: tests/paramref_arguments_roundtrip.cwl
34853485
doc: Confirm that records with defaults are accepted
34863486
tags: [ required, command_line_tool ]
3487+
3488+
- label: record_outputeval
3489+
output:
3490+
references:
3491+
genome_fa:
3492+
class: File
3493+
basename: GRCm38.primary_assembly.genome.fa
3494+
checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709
3495+
size: 0
3496+
annotation_gtf:
3497+
class: File
3498+
basename: gencode.vM21.primary_assembly.annotation.gtf
3499+
checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709
3500+
size: 0
3501+
tool: tests/record_outputeval.cwl
3502+
doc: Use of outputEval on a record itself, not the fields of the record
3503+
tags: [ inline_javascript, command_line_tool ]
3504+
3505+
- label: record_outputeval_nojs
3506+
output:
3507+
references:
3508+
annotation_gtf: gencode.vM21.primary_assembly.annotation.gtf
3509+
genome_fa: GRCm38.primary_assembly.genome.fa
3510+
summary:
3511+
class: File
3512+
checksum: sha1$c0bf6c4db73d4fc08ee24c7288825c09f9cb3cea
3513+
size: 79
3514+
tool: tests/record_outputeval_nojs.cwl
3515+
doc: Use of outputEval on a record itself, not the fields of the record (without javascript)
3516+
tags: [ required, command_line_tool ]

tests/record_outputeval.cwl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
cwlVersion: v1.2
2+
class: CommandLineTool
3+
requirements:
4+
InlineJavascriptRequirement: {}
5+
6+
inputs:
7+
gtf_version:
8+
type: string
9+
default: M21
10+
organism:
11+
type: string
12+
default: mouse
13+
organism_prefix:
14+
type: string
15+
default: m
16+
17+
baseCommand:
18+
- bash
19+
- -c
20+
arguments:
21+
- touch GRC$(inputs.organism_prefix)38.primary_assembly.genome.fa ; touch gencode.v$(inputs.gtf_version).primary_assembly.annotation.gtf
22+
outputs:
23+
- id: references
24+
type:
25+
name: References
26+
fields:
27+
- name: genome_fa
28+
type: File
29+
- name: annotation_gtf
30+
type: File
31+
type: record
32+
outputBinding:
33+
outputEval: '$({ "genome_fa": { "class": "File", "path": runtime.outdir+"/"+"GRC"
34+
+ inputs.organism_prefix + "38.primary_assembly.genome.fa" }, "annotation_gtf":
35+
{ "class": "File", "path": runtime.outdir+"/"+"gencode.v" + inputs.gtf_version
36+
+ ".primary_assembly.annotation.gtf" } })'

tests/record_outputeval_nojs.cwl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
cwlVersion: v1.2
2+
class: CommandLineTool
3+
inputs:
4+
ref:
5+
type:
6+
type: record
7+
fields:
8+
genome_fa: string
9+
annotation_gtf: string
10+
default: { genome_fa: GRCm38.primary_assembly.genome.fa,
11+
annotation_gtf: gencode.vM21.primary_assembly.annotation.gtf }
12+
13+
baseCommand: echo
14+
arguments:
15+
- $(inputs.ref.genome_fa) $(inputs.ref.annotation_gtf)
16+
outputs:
17+
references:
18+
type:
19+
type: record
20+
fields:
21+
genome_fa: string
22+
annotation_gtf: string
23+
outputBinding:
24+
outputEval: $(inputs.ref)
25+
summary:
26+
type: stdout

0 commit comments

Comments
 (0)