Skip to content

Commit

Permalink
Add tests for file literal size filtering.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Jan 25, 2019
1 parent 399e2ef commit d6b1f04
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
20 changes: 20 additions & 0 deletions v1.0/conformance_test_v1.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2623,3 +2623,23 @@
label: step_input_loadContents_fails_over_64kb_control
doc: Test loadContents on step input fails over 64kb (control for previous test)
tags: [workflow, inline_javascript]

- tool: v1.0/file-literal-output-size.cwl
job: v1.0/size_64kb_plus_1.json
should_fail: true
id: 202
label: file_literal_size_fails_over_64kb
doc: Test file literals of size over 64kb fail.
tags: [ expression_tool ]

- tool: v1.0/file-literal-output-size.cwl
job: v1.0/size_64kb.json
output:
lit:
class: File
checksum: "sha1$79db5888b5d38e10afbdbd14a19cd1caa9044c65"
size: 65536
id: 203
label: file_literal_size_fails_over_64kb_control
doc: Test file literals of size over 64kb fail (control for previous test)
tags: [ expression_tool ]
15 changes: 15 additions & 0 deletions v1.0/v1.0/file-literal-output-size.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env cwl-runner

class: ExpressionTool
cwlVersion: v1.0
requirements:
- class: InlineJavascriptRequirement

inputs:
size: int
outputs: { lit: File }
expression: |
${
var contents = "a".repeat(inputs.size);
return { "lit": { "class": "File", "basename": "lit", "contents": contents } };
}
1 change: 1 addition & 0 deletions v1.0/v1.0/size_64kb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"size": 65536}
1 change: 1 addition & 0 deletions v1.0/v1.0/size_64kb_plus_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"size": 65537}

0 comments on commit d6b1f04

Please sign in to comment.