From 6fd9a1cffc50d6751c4e9e7b52fab1a81cc08aa3 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sat, 19 Feb 2022 13:43:56 +0100 Subject: [PATCH] Test for outputEval on a record type itself, not its fields --- conformance_tests.yaml | 30 ++++++++++++++++++++++++++ tests/record_outputeval.cwl | 36 ++++++++++++++++++++++++++++++++ tests/record_outputeval_nojs.cwl | 26 +++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 tests/record_outputeval.cwl create mode 100644 tests/record_outputeval_nojs.cwl diff --git a/conformance_tests.yaml b/conformance_tests.yaml index 151cac5d..86f4ee38 100644 --- a/conformance_tests.yaml +++ b/conformance_tests.yaml @@ -3484,3 +3484,33 @@ tool: tests/paramref_arguments_roundtrip.cwl doc: Confirm that records with defaults are accepted tags: [ required, command_line_tool ] + +- label: record_outputeval + output: + references: + genome_fa: + class: File + basename: GRCm38.primary_assembly.genome.fa + checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709 + size: 0 + annotation_gtf: + class: File + basename: gencode.vM21.primary_assembly.annotation.gtf + checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709 + size: 0 + tool: tests/record_outputeval.cwl + doc: Use of outputEval on a record itself, not the fields of the record + tags: [ inline_javascript, command_line_tool ] + +- label: record_outputeval_nojs + output: + references: + annotation_gtf: gencode.vM21.primary_assembly.annotation.gtf + genome_fa: GRCm38.primary_assembly.genome.fa + summary: + class: File + checksum: sha1$c0bf6c4db73d4fc08ee24c7288825c09f9cb3cea + size: 79 + tool: tests/record_outputeval_nojs.cwl + doc: Use of outputEval on a record itself, not the fields of the record (without javascript) + tags: [ required, command_line_tool ] diff --git a/tests/record_outputeval.cwl b/tests/record_outputeval.cwl new file mode 100644 index 00000000..6540c1e1 --- /dev/null +++ b/tests/record_outputeval.cwl @@ -0,0 +1,36 @@ +cwlVersion: v1.2 +class: CommandLineTool +requirements: + InlineJavascriptRequirement: {} + +inputs: + gtf_version: + type: string + default: M21 + organism: + type: string + default: mouse + organism_prefix: + type: string + default: m + +baseCommand: + - bash + - -c +arguments: + - touch GRC$(inputs.organism_prefix)38.primary_assembly.genome.fa ; touch gencode.v$(inputs.gtf_version).primary_assembly.annotation.gtf +outputs: + - id: references + type: + name: References + fields: + - name: genome_fa + type: File + - name: annotation_gtf + type: File + type: record + outputBinding: + outputEval: '$({ "genome_fa": { "class": "File", "path": runtime.outdir+"/"+"GRC" + + inputs.organism_prefix + "38.primary_assembly.genome.fa" }, "annotation_gtf": + { "class": "File", "path": runtime.outdir+"/"+"gencode.v" + inputs.gtf_version + + ".primary_assembly.annotation.gtf" } })' diff --git a/tests/record_outputeval_nojs.cwl b/tests/record_outputeval_nojs.cwl new file mode 100644 index 00000000..b29c6622 --- /dev/null +++ b/tests/record_outputeval_nojs.cwl @@ -0,0 +1,26 @@ +cwlVersion: v1.2 +class: CommandLineTool +inputs: + ref: + type: + type: record + fields: + genome_fa: string + annotation_gtf: string + default: { genome_fa: GRCm38.primary_assembly.genome.fa, + annotation_gtf: gencode.vM21.primary_assembly.annotation.gtf } + +baseCommand: echo +arguments: + - $(inputs.ref.genome_fa) $(inputs.ref.annotation_gtf) +outputs: + references: + type: + type: record + fields: + genome_fa: string + annotation_gtf: string + outputBinding: + outputEval: $(inputs.ref) + summary: + type: stdout