From 65f30fa21a575e914a5cdeee5cd9d0aa5b714a5a Mon Sep 17 00:00:00 2001 From: mccalluc Date: Wed, 11 Dec 2019 15:24:50 -0500 Subject: [PATCH 1/4] Workflow which runs ls --- workflows/cwl/simple-cli-example/test-input/a.txt | 0 workflows/cwl/simple-cli-example/test-input/z.txt | 0 workflows/cwl/simple-cli-example/test-job.yml | 3 +++ workflows/cwl/simple-cli-example/workflow.cwl | 15 +++++++++++++++ 4 files changed, 18 insertions(+) create mode 100644 workflows/cwl/simple-cli-example/test-input/a.txt create mode 100644 workflows/cwl/simple-cli-example/test-input/z.txt create mode 100644 workflows/cwl/simple-cli-example/test-job.yml create mode 100755 workflows/cwl/simple-cli-example/workflow.cwl diff --git a/workflows/cwl/simple-cli-example/test-input/a.txt b/workflows/cwl/simple-cli-example/test-input/a.txt new file mode 100644 index 0000000..e69de29 diff --git a/workflows/cwl/simple-cli-example/test-input/z.txt b/workflows/cwl/simple-cli-example/test-input/z.txt new file mode 100644 index 0000000..e69de29 diff --git a/workflows/cwl/simple-cli-example/test-job.yml b/workflows/cwl/simple-cli-example/test-job.yml new file mode 100644 index 0000000..94e81e6 --- /dev/null +++ b/workflows/cwl/simple-cli-example/test-job.yml @@ -0,0 +1,3 @@ +input_directory: + class: Directory + path: test-input diff --git a/workflows/cwl/simple-cli-example/workflow.cwl b/workflows/cwl/simple-cli-example/workflow.cwl new file mode 100755 index 0000000..44db9b0 --- /dev/null +++ b/workflows/cwl/simple-cli-example/workflow.cwl @@ -0,0 +1,15 @@ +#!/usr/bin/env cwl-runner + +cwlVersion: v1.0 +class: CommandLineTool +baseCommand: ls +inputs: + input_directory: + type: Directory + inputBinding: + position: 1 +stdout: + ls.txt +outputs: + output_file: + type: stdout From 964dc812f499515f6493e3969fcd567d2d2a83a4 Mon Sep 17 00:00:00 2001 From: mccalluc Date: Wed, 11 Dec 2019 15:43:59 -0500 Subject: [PATCH 2/4] Add test --- .gitignore | 1 + test.sh | 20 +++++++++++++++++++ .../test-output-expected/ls.txt | 2 ++ 3 files changed, 23 insertions(+) create mode 100755 test.sh create mode 100644 workflows/cwl/simple-cli-example/test-output-expected/ls.txt diff --git a/.gitignore b/.gitignore index ddeaaf8..edcbe0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ airflow.cfg +**/test-output-actual # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..fae69c4 --- /dev/null +++ b/test.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -o errexit + +start() { echo travis_fold':'start:$1; echo $1; } +end() { echo travis_fold':'end:$1; } +die() { set +v; echo "$*" 1>&2 ; sleep 1; exit 1; } + +CWL_NAME=workflow.cwl +OUTPUT_NAME=test-output-actual +for CWL_PATH in workflows/cwl/*/workflow.cwl; do + cd `dirname $CWL_PATH` + LABEL=`basename $PWD` + start $LABEL + mkdir $OUTPUT_NAME || echo 'Output directory already exists...' + cd $OUTPUT_NAME + ../$CWL_NAME ../test-job.yml + cd .. + diff -w -r test-output-expected $OUTPUT_NAME -x .DS_Store | head -n100 | cut -c 1-100 + end $LABEL +done diff --git a/workflows/cwl/simple-cli-example/test-output-expected/ls.txt b/workflows/cwl/simple-cli-example/test-output-expected/ls.txt new file mode 100644 index 0000000..f6cf350 --- /dev/null +++ b/workflows/cwl/simple-cli-example/test-output-expected/ls.txt @@ -0,0 +1,2 @@ +b.txt +y.txt From a21a8acf13ec4ccd7933e747dd3276fbb308f025 Mon Sep 17 00:00:00 2001 From: mccalluc Date: Wed, 11 Dec 2019 15:46:46 -0500 Subject: [PATCH 3/4] Fix test fixture --- workflows/cwl/simple-cli-example/test-output-expected/ls.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflows/cwl/simple-cli-example/test-output-expected/ls.txt b/workflows/cwl/simple-cli-example/test-output-expected/ls.txt index f6cf350..8933cae 100644 --- a/workflows/cwl/simple-cli-example/test-output-expected/ls.txt +++ b/workflows/cwl/simple-cli-example/test-output-expected/ls.txt @@ -1,2 +1,2 @@ -b.txt -y.txt +a.txt +z.txt From 2f0c500b829b5357eb01f0a9171f00b95fe08b07 Mon Sep 17 00:00:00 2001 From: mccalluc Date: Wed, 11 Dec 2019 16:00:52 -0500 Subject: [PATCH 4/4] Travis and requirements.txt --- .travis.yml | 6 ++++++ requirements.txt | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 .travis.yml create mode 100644 requirements.txt diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7acae01 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: python +python: + - '3.7' +cache: pip +script: + - ./test.sh diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..dee47cd --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +cwlref-runner==1.0 +cwltool==1.0.20191206125148