Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion conformance_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3561,4 +3561,15 @@
`echo a && echo b > out.txt`, but instead will produce the correct `echo a && echo b`,
and capture the output correctly.
tags: [ shell_command, command_line_tool ]


- tool: tests/schemadef_types_with_import-wf.cwl
job: tests/schemadef_types_with_import-job.json
output: {
"out": "1970-01-01T00:00:00Z\n"
}
label: schemadef_types_with_import
doc: >-
Test SchemaDefRequirement with a workflow, with the `$import` under types.
It is similar to schemadef-wf, but the `$import` is different.
tags: [ workflow, schema_def ]

22 changes: 22 additions & 0 deletions tests/schemadef_types_with_import-job.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"readgroups_bam":
{
"bam": {
"class": "File",
"format": "edam:format_2572",
"location": "schemadef_types_with_import-test.bam"
},
"readgroup_meta_list":
[
{
"CN": "UNKNOWN",
"DT": "1970-01-01T00:00:00Z",
"ID": "SRR622461",
"LB": "Illumina NA12878",
"PI": "250",
"PL": "ILLUMINA",
"SM": "NA12878"
}
]
}
}
Empty file.
26 changes: 26 additions & 0 deletions tests/schemadef_types_with_import-tool.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env cwl-runner
class: CommandLineTool
cwlVersion: v1.2

requirements:
- class: InlineJavascriptRequirement
- class: SchemaDefRequirement
types:
- $import: schemadef_types_with_import_readgroup.yml

inputs:
- id: message
type: "schemadef_types_with_import_readgroup.yml#readgroups_bam_file"
inputBinding:
valueFrom: $(self.readgroup_meta_list[0]['DT'])

outputs:
- id: out
type: string
outputBinding:
glob: output.txt
loadContents: true
outputEval: $(self[0].contents)

stdout: output.txt
baseCommand: echo
25 changes: 25 additions & 0 deletions tests/schemadef_types_with_import-wf.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env cwl-runner
# See https://github.com/jeremiahsavage/cwl_schemadef/, thanks to Jeremiah H. Savage.
cwlVersion: v1.2
class: Workflow

requirements:
- class: SchemaDefRequirement
types:
- $import: schemadef_types_with_import_readgroup.yml

inputs:
readgroups_bam:
type: "schemadef_types_with_import_readgroup.yml#readgroups_bam_file"

steps:
step1:
run: schemadef_types_with_import-tool.cwl
in:
message: readgroups_bam
out: [out]

outputs:
out:
type: string
outputSource: step1/out
27 changes: 27 additions & 0 deletions tests/schemadef_types_with_import_readgroup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- name: readgroup_meta
type: record
fields:
- name: CN
type: string
- name: DT
type: string
- name: ID
type: string
- name: LB
type: string
- name: PI
type: string
- name: PL
type: string
- name: SM
type: string

- name: readgroups_bam_file
type: record
fields:
- name: bam
type: File
- name: readgroup_meta_list
type:
type: array
items: readgroup_meta