- job: draft-3/bwa-mem-job.json
  tool: draft-3/bwa-mem-tool.cwl
  output:
    args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3',
      chr20.fa,
      example_human_Illumina.pe_1.fastq,
      example_human_Illumina.pe_2.fastq]
  doc: General test of command line generation

- output:
    args: [bwa, mem, chr20.fa,
      "-XXX",
      "-YYY", example_human_Illumina.pe_1.fastq,
      "-YYY", example_human_Illumina.pe_2.fastq]
  job: draft-3/bwa-mem-job.json
  tool: draft-3/binding-test.cwl
  doc: Test nested prefixes with arrays

- output:
    args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length,
    '20', stage2, map1, --max-seq-length, '20', --min-seq-length, '10', --seed-length,
    '16', map2, --max-seed-hits, '-1', --max-seq-length, '20', --min-seq-length, '10']
  job: draft-3/tmap-job.json
  tool: draft-3/tmap-tool.cwl
  doc: Test nested command line bindings

- output:
    args: [cat, hello.txt]
  job: draft-3/cat-job.json
  tool: draft-3/cat1-testcli.cwl
  doc: Test command line with optional input (missing)

- output:
    args: [cat, -n, hello.txt]
  job: draft-3/cat-n-job.json
  tool: draft-3/cat1-testcli.cwl
  doc: Test command line with optional input (provided)

- output:
    "foo": {
        "checksum": "sha1$63da67422622fbf9251a046d7a34b7ea0fd4fead",
        "class": "File",
        "path": "foo.txt",
        "size": 22
    }
  job: draft-3/cat-job.json
  tool: draft-3/template-tool.cwl
  doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig feature

- job: draft-3/cat-job.json
  output:
    output_file:
      class: File
      checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b
      path: output.txt
      size: 13
  tool: draft-3/cat3-tool.cwl
  doc: Test command execution in Docker with stdout redirection

- job: draft-3/cat-job.json
  output:
    output_txt:
      class: File
      checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b
      path: output.txt
      size: 13
  tool: draft-3/cat4-tool.cwl
  doc: Test command execution in Docker with stdin and stdout redirection

- job: draft-3/empty.json
  tool: draft-3/null-expression1-tool.cwl
  output:
    output: 1
  doc: Test default usage of Any in expressions.

- job: draft-3/null-expression1-job.json
  tool: draft-3/null-expression1-tool.cwl
  output:
    output: 2
  doc: Test explicitly passing null to Any type inputs with default values.

- job: draft-3/null-expression2-job.json
  tool: draft-3/null-expression1-tool.cwl
  output:
    output: 2
  doc: Testing the string 'null' does not trip up an Any with a default value.

## TODO: Upgrade framework to allow specifying negative tests.
# - job: draft-3/empty.json
#   tool: draft-3/null-expression2-tool.cwl
#   failure: true
#   doc: Test Any without defaults can be unspecified.

# - job: draft-3/null-expression1-job.json
#   tool: draft-3/null-expression2-tool.cwl
#   failure: true
#   doc: Test explicitly passing null to Any type without a default value.

- job: draft-3/null-expression2-job.json
  tool: draft-3/null-expression2-tool.cwl
  output:
    output: 2
  doc: Testing the string 'null' does not trip up an Any without a default value.

- job: draft-3/wc-job.json
  output:
    output:
      class: File
      checksum: sha1$631bfbac524e2d04cdcc5ec33ade827fc10b06ae
      path: output
      size: 15
  tool: draft-3/wc-tool.cwl
  doc: Test command execution in with stdin and stdout redirection

- job: draft-3/parseInt-job.json
  output: {output: 42}
  tool: draft-3/parseInt-tool.cwl
  doc: Test ExpressionTool with Docker-based expression engine

- job: draft-3/wc-job.json
  output: {output: 16}
  tool: draft-3/wc2-tool.cwl
  doc: Test outputEval to transform output

- job: draft-3/wc-job.json
  output: {count_output: 16}
  tool: draft-3/count-lines1-wf.cwl
  doc: Test two step workflow with imported tools

- job: draft-3/wc-job.json
  output: {count_output: 16}
  tool: draft-3/count-lines2-wf.cwl
  doc: Test two step workflow with inline tools

- job: draft-3/count-lines3-job.json
  output:
    count_output: [16, 1]
  tool: draft-3/count-lines3-wf.cwl
  doc: Test single step workflow with Scatter step

- job: draft-3/count-lines4-job.json
  output:
    count_output: [16, 1]
  tool: draft-3/count-lines4-wf.cwl
  doc: |
    Test single step workflow with Scatter step and two data links connected to
    same input, default merge behavior

- job: draft-3/count-lines6-job.json
  output:
    count_output: [32, 2]
  tool: draft-3/count-lines6-wf.cwl
  doc: |
    Test single step workflow with Scatter step and two data links connected to
    same input, nested merge behavior

- job: draft-3/count-lines6-job.json
  output:
    count_output: 34
  tool: draft-3/count-lines7-wf.cwl
  doc: |
    Test single step workflow with Scatter step and two data links connected to
    same input, flattened merge behavior

- job: draft-3/empty.json
  output: {count_output: 1}
  tool: draft-3/count-lines5-wf.cwl
  doc: Test workflow with default value for input parameter (missing)

- job: draft-3/wc-job.json
  output: {count_output: 16}
  tool: draft-3/count-lines5-wf.cwl
  doc: Test workflow with default value for input parameter (provided)

- job: draft-3/env-job.json
  output:
    out:
      class: File
      checksum: sha1$b3ec4ed1749c207e52b3a6d08c59f31d83bff519
      path: out
      size: 15
  tool: draft-3/env-tool1.cwl
  doc: Test EnvVarRequirement

- job: draft-3/scatter-job1.json
  output:
    out: ["foo one", "foo two", "foo three", "foo four"]
  tool: draft-3/scatter-wf1.cwl
  doc: Test workflow scatter with single scatter parameter

- job: draft-3/scatter-job2.json
  output:
    out: [["foo one three", "foo one four"], ["foo two three", "foo two four"]]
  tool: draft-3/scatter-wf2.cwl
  doc: Test workflow scatter with two scatter parameters and nested_crossproduct join method

- job: draft-3/scatter-job2.json
  output:
    out: ["foo one three", "foo one four", "foo two three", "foo two four"]
  tool: "draft-3/scatter-wf3.cwl#main"
  doc: Test workflow scatter with two scatter parameters and flat_crossproduct join method

- job: draft-3/scatter-job2.json
  output:
    out: ["foo one three", "foo two four"]
  tool: "draft-3/scatter-wf4.cwl#main"
  doc: Test workflow scatter with two scatter parameters and dotproduct join method

- tool: draft-3/echo-tool.cwl
  job: draft-3/env-job.json
  output:
    {"out": "hello test env\n"}
  doc: Test Any type input parameter

- job: draft-3/wc-job.json
  output: {count_output: 16}
  tool: draft-3/count-lines8-wf.cwl
  doc: Test nested workflow

- job: draft-3/env-job.json
  output:
    out:
      class: File
      checksum: sha1$b3ec4ed1749c207e52b3a6d08c59f31d83bff519
      path: out
      size: 15
  tool: draft-3/env-wf1.cwl
  doc: Test requirement priority

- job: draft-3/env-job.json
  output:
    out:
      class: File
      checksum: sha1$cdc1e84968261d6a7575b5305945471f8be199b6
      path: out
      size: 9
  tool: draft-3/env-wf2.cwl
  doc: Test requirements override hints

- job: draft-3/empty.json
  output: {count_output: 16}
  tool: draft-3/count-lines9-wf.cwl
  doc: Test default value on input parameter

- job: draft-3/revsort-job.json
  output:
    output:
      class: File
      checksum: sha1$b9214658cc453331b62c2282b772a5c063dbd284
      path: output.txt
      size: 1111
  tool: draft-3/revsort.cwl
  doc: Test sample workflows from the specification

- job: draft-3/cat-job.json
  output:
    output_file:
      class: File
      checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b
      path: output.txt
      size: 13
  tool: draft-3/cat5-tool.cwl
  doc: Test unknown hints are ignored.

- job: draft-3/search-job.json
  output:
    outfile:
      class: File
      checksum: sha1$e2dc9daaef945ac15f01c238ed2f1660f60909a0
      path: result.txt
      size: 142
    indexedfile: {
        "path": "input.txt",
        "class": "File",
        "checksum": "sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376",
        "secondaryFiles": [
            {
                "path": "input.txt.idx1",
                "class": "File"
            },
            {
                "path": "input.idx2",
                "class": "File"
            },
            {
                "path": "input.txt.idx3",
                "class": "File"
            },
            {
                "path": "input.txt.idx4",
                "class": "File"
            },
            {
                "path": "input.txt.idx5",
                "class": "File"
            }
        ],
        "size": 1111
    }
  tool: "draft-3/search.cwl#main"
  doc: |
    Test CreateFileRequirement linking input files and capturing secondaryFiles
    on input and output.

- job: draft-3/rename-job.json
  output:
    outfile:
      class: File
      checksum: sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376
      path: fish.txt
      size: 1111
  tool: draft-3/rename.cwl
  doc: |
    Test CreateFileRequirement with expression in filename.

- job: draft-3/wc-job.json
  output:
    output: 16
  tool: draft-3/wc4-tool.cwl
  doc: |
    Test inline expressions

- job: draft-3/schemadef-job.json
  output:
    output:
        path: output.txt
        size: 12
        class: File
        checksum: "sha1$f12e6cfe70f3253f70b0dbde17c692e7fb0f1e5e"
  tool: draft-3/schemadef-tool.cwl
  doc: |
    Test SchemaDefRequirement definition used in tool parameter

- job: draft-3/schemadef-job.json
  output:
    output:
        path: output.txt
        size: 12
        class: File
        checksum: "sha1$f12e6cfe70f3253f70b0dbde17c692e7fb0f1e5e"
  tool: draft-3/schemadef-wf.cwl
  doc: |
    Test SchemaDefRequirement definition used in workflow parameter

- job: draft-3/empty.json
  output: {
    "t1": {
        "bar": {
            "b az": 2,
            "b\"az": null,
            "b'az": true,
            "baz": "zab1",
            "buz": [
                "a",
                "b",
                "c"
            ]
        }
    },
    "t10": true,
    "t11": true,
    "t12": null,
    "t13": "-zab1",
    "t14": "-zab1",
    "t15": "-zab1",
    "t16": "-zab1",
    "t17": "zab1 zab1",
    "t18": "zab1 zab1",
    "t19": "zab1 zab1",
    "t2": {
        "b az": 2,
        "b\"az": null,
        "b'az": true,
        "baz": "zab1",
        "buz": [
            "a",
            "b",
            "c"
        ]
    },
    "t20": "zab1 zab1",
    "t21": "2 2",
    "t22": "true true",
    "t23": "true true",
    "t24": "null null",
    "t25": "b",
    "t26": "b b",
    "t3": {
        "b az": 2,
        "b\"az": null,
        "b'az": true,
        "baz": "zab1",
        "buz": [
            "a",
            "b",
            "c"
        ]
    },
    "t4": {
        "b az": 2,
        "b\"az": null,
        "b'az": true,
        "baz": "zab1",
        "buz": [
            "a",
            "b",
            "c"
        ]
    },
    "t5": "zab1",
    "t6": "zab1",
    "t7": "zab1",
    "t8": "zab1",
    "t9": 2
    }
  tool: draft-3/params.cwl
  doc: |
    Test parameter evaluation, no support for JS expressions

- job: draft-3/empty.json
  output: {
    "t1": {
        "bar": {
            "b az": 2,
            "b\"az": null,
            "b'az": true,
            "baz": "zab1",
            "buz": [
                "a",
                "b",
                "c"
            ]
        }
    },
    "t10": true,
    "t11": true,
    "t12": null,
    "t13": "-zab1",
    "t14": "-zab1",
    "t15": "-zab1",
    "t16": "-zab1",
    "t17": "zab1 zab1",
    "t18": "zab1 zab1",
    "t19": "zab1 zab1",
    "t2": {
        "b az": 2,
        "b\"az": null,
        "b'az": true,
        "baz": "zab1",
        "buz": [
            "a",
            "b",
            "c"
        ]
    },
    "t20": "zab1 zab1",
    "t21": "2 2",
    "t22": "true true",
    "t23": "true true",
    "t24": "null null",
    "t25": "b",
    "t26": "b b",
    "t3": {
        "b az": 2,
        "b\"az": null,
        "b'az": true,
        "baz": "zab1",
        "buz": [
            "a",
            "b",
            "c"
        ]
    },
    "t4": {
        "b az": 2,
        "b\"az": null,
        "b'az": true,
        "baz": "zab1",
        "buz": [
            "a",
            "b",
            "c"
        ]
    },
    "t5": "zab1",
    "t6": "zab1",
    "t7": "zab1",
    "t8": "zab1",
    "t9": 2
    }
  tool: draft-3/params2.cwl
  doc: |
    Test parameter evaluation, with support for JS expressions

- output: {}
  job: draft-3/cat-job.json
  tool: draft-3/metadata.cwl
  doc: Test metadata

- job: draft-3/formattest-job.json
  output:
    output:
        "path": "output.txt"
        "format": "http://edamontology.org/format_2330"
        "size": 1111
        "class": "File"
        "checksum": "sha1$97fe1b50b4582cebc7d853796ebd62e3e163aa3f"
  tool: draft-3/formattest.cwl
  doc: |
    Test simple format checking.

- job: draft-3/formattest2-job.json
  output:
    output:
        "path": "output.txt"
        "format": "http://edamontology.org/format_1929"
        "size": 12010
        "class": "File"
        "checksum": "sha1$971d88faeda85a796752ecf752b7e2e34f1337ce"
  tool: draft-3/formattest2.cwl
  doc: |
    Test format checking against ontology using subclassOf.

- job: draft-3/formattest2-job.json
  output:
    output:
        "path": "output.txt"
        "format": "http://edamontology.org/format_1929"
        "size": 12010
        "class": "File"
        "checksum": "sha1$971d88faeda85a796752ecf752b7e2e34f1337ce"
  tool: draft-3/formattest3.cwl
  doc: |
    Test format checking against ontology using equivalentClass.

- tool: draft-3/optional-output.cwl
  job: draft-3/cat-job.json
  output:
    optional_file: null
    output_file:
        path: output.txt
        size: 13
        class: "File"
        checksum: "sha1$47a013e660d408619d894b20806b1d5086aab03b"
  doc: |
    Test optional output file and optional secondaryFile on output.

- job: draft-3/step-valuefrom-wf.json
  output: {count_output: 16}
  tool: draft-3/step-valuefrom-wf.cwl
  doc: Test valueFrom on workflow step.

- job: draft-3/step-valuefrom-job.json
  output: {val: "3\n"}
  tool: draft-3/step-valuefrom2-wf.cwl
  doc: Test valueFrom on workflow step with multiple sources

- job: draft-3/step-valuefrom-job.json
  output: {val: "3\n"}
  tool: draft-3/step-valuefrom3-wf.cwl
  doc: Test valueFrom on workflow step referencing other inputs

- job: draft-3/record-output-job.json
  output:
    "orec": {
        "ofoo": {
            "path": "foo",
            "size": 1111,
            "class": "File",
            "checksum": "sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376"
        },
        "obar": {
            "path": "bar",
            "size": 12010,
            "class": "File",
            "checksum": "sha1$aeb3d11bdf536511649129f4077d5cda6a324118"
        }
    }
  tool: draft-3/record-output.cwl
  doc: Test record type output binding.

- job: draft-3/empty.json
  output: {
    "foo": {
        "path": "foo",
        "class": "File"
    }
  }
  tool: draft-3/test-cwl-out.cwl
  doc: Test support for reading cwl.output.json when running in Docker container

- job: draft-3/abc.json
  output:
    files: [{
        "path": "a",
        "size": 0,
        "class": "File",
        "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709"
    },
    {
        "path": "b",
        "size": 0,
        "class": "File",
        "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709"
    },
    {
        "path": "c",
        "size": 0,
        "class": "File",
        "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709"
    }]
  tool: draft-3/glob-expr-list.cwl
  doc: Test support for returning multiple glob patterns from expression

- job: draft-3/scatter-valuefrom-job1.json
  output:
    out: ["foo one one", "foo one two", "foo one three", "foo one four"]
  tool: draft-3/scatter-valuefrom-wf1.cwl
  doc: Test workflow scatter with single scatter parameter and valueFrom on step input

- job: draft-3/scatter-valuefrom-job2.json
  output:
    out: [["foo one one three", "foo one one four"], ["foo one two three", "foo one two four"]]
  tool: draft-3/scatter-valuefrom-wf2.cwl
  doc: Test workflow scatter with two scatter parameters and nested_crossproduct join method and valueFrom on step input

- job: draft-3/scatter-valuefrom-job2.json
  output:
    out: ["foo one one three", "foo one one four", "foo one two three", "foo one two four"]
  tool: "draft-3/scatter-valuefrom-wf3.cwl#main"
  doc: Test workflow scatter with two scatter parameters and flat_crossproduct join method and valueFrom on step input

- job: draft-3/scatter-valuefrom-job2.json
  output:
    out: ["foo one one three", "foo one two four"]
  tool: "draft-3/scatter-valuefrom-wf4.cwl#main"
  doc: Test workflow scatter with two scatter parameters and dotproduct join method and valueFrom on step input

- job: draft-3/conflict-job.json
  output: {
    "fileout": {
        "path": "out.txt",
        "checksum": "sha1$a2d8d6e7b28295dc9977dc3bdb652ddd480995f0",
        "class": "File",
        "size": 25
    }
  }
  tool: "draft-3/conflict-wf.cwl#collision"
  doc: Test workflow two input files with same name.
