Skip to content

Commit

Permalink
Merge pull request #98 from common-workflow-language/no-side-effect-11
Browse files Browse the repository at this point in the history
Change the examples in Section 11 not to use side-effects
  • Loading branch information
mr-c authored Feb 26, 2018
2 parents 166c16e + 2c68722 commit 736789c
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 11 deletions.
54 changes: 45 additions & 9 deletions _episodes/11-records.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ parameters together to describe these two conditions.

~~~
$ cwl-runner record.cwl record-job1.yml
Workflow error:
Error validating input record, could not validate field `dependent_parameters` because
missing required field `itemB`
Workflow error, try again with --debug for more information:
Invalid job input record:
record-job1.yml:1:1: the `dependent_parameters` field is not valid because
missing required field `itemB`
~~~
{: .output}

Expand All @@ -49,10 +50,28 @@ In the first example, you can't provide `itemA` without also providing `itemB`.

~~~
$ cwl-runner record.cwl record-job2.yml
[job 140566927111376] /home/example$ echo -A one -B two -C three
-A one -B two -C three
record-job2.yml:6:3: invalid field `itemD`, expected one of: 'itemC'
[job record.cwl] /home/example$ echo \
-A \
one \
-B \
two \
-C \
three > /home/example/output.txt
[job record.cwl] completed success
{
"example_out": {
"location": "file:///home/example/11-records/output.txt",
"basename": "output.txt",
"class": "File",
"checksum": "sha1$329fe3b598fed0dfd40f511522eaf386edb2d077",
"size": 23,
"path": "/home/example/output.txt"
}
}
Final process status is success
{}
$ cat output.txt
-A one -B two -C three
~~~
{: .output}

Expand All @@ -68,10 +87,27 @@ is added to the command line and `itemD` is ignored.

~~~
$ cwl-runner record.cwl record-job3.yml
[job 140606932172880] /home/example$ echo -A one -B two -D four
-A one -B two -D four
[job record.cwl] /home/example$ echo \
-A \
one \
-B \
two \
-D \
four > /home/example/output.txt
[job record.cwl] completed success
{
"example_out": {
"location": "file:///home/example/output.txt",
"basename": "output.txt",
"class": "File",
"checksum": "sha1$77f572b28e441240a5e30eb14f1d300bcc13a3b4",
"size": 22,
"path": "/home/example/output.txt"
}
}
Final process status is success
{}
$ cat output.txt
-A one -B two -D four
~~~
{: .output}

Expand Down
5 changes: 4 additions & 1 deletion _includes/cwl/11-records/record.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ inputs:
type: string
inputBinding:
prefix: -D
outputs: []
outputs:
example_out:
type: stdout
stdout: output.txt
baseCommand: echo
23 changes: 22 additions & 1 deletion _includes/cwl/conformance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,33 @@
size: 0

# Section 11 depends on side-effects
# Rest two examples in Section 11 depend on side-effects
- doc: Test for section 11 (1st example)
job: 11-records/record-job1.yml
tool: 11-records/record.cwl
should_fail: true

- doc: Test for section 11 (2nd example)
job: 11-records/record-job2.yml
tool: 11-records/record.cwl
output:
example_out:
class: File
checksum: sha1$329fe3b598fed0dfd40f511522eaf386edb2d077
basename: output.txt
location: Any
size: 23

- doc: Test for section 11 (3rd example)
job: 11-records/record-job3.yml
tool: 11-records/record.cwl
output:
example_out:
class: File
checksum: sha1$77f572b28e441240a5e30eb14f1d300bcc13a3b4
basename: output.txt
location: Any
size: 22

# Section 12 depends on side-effects
# Section 13 depends on side-effects
# Section 14 depends on side-effects
Expand Down

0 comments on commit 736789c

Please sign in to comment.