forked from agduncan94/md5sum
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from dockstore-testing/develop
Merge to master
- Loading branch information
Showing
9 changed files
with
95 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
sudo: required | ||
|
||
services: | ||
- docker | ||
|
||
language: python | ||
|
||
python: | ||
- "3.6" | ||
|
||
before_install: | ||
# Download Cromwell | ||
- wget -O $TRAVIS_BUILD_DIR/cromwell-42.jar https://github.com/broadinstitute/cromwell/releases/download/42/cromwell-42.jar; | ||
- curl -o requirements.txt "https://dockstore.org/api/metadata/runner_dependencies?client_version=1.6.0&python_version=3" | ||
|
||
install: | ||
- pip install -r requirements.txt | ||
|
||
script: | ||
- docker build -t test-image -f checker/Dockerfile checker | ||
- >- | ||
sed 's/dockerPull:.*/dockerPull: test-image:latest/g' checker/md5sum-checker.cwl | ||
- >- | ||
sed 's/docker:.*/docker: "test-image:latest"/g' checker/md5sum-checker.wdl | ||
- python -m unittest discover -s . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"input_file": { | ||
"class": "File", | ||
"path": "md5sum.input" | ||
}, | ||
"expected_md5": "not a matching md5sum" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"checkerWorkflow.inputFile": "md5sum.input", | ||
"checkerWorkflow.expectedMd5sum": "not a real md5sum" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"input_file": { | ||
"class": "File", | ||
"path": "md5sum.input" | ||
"path": "../md5sum.input" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"ga4ghMd5.inputFile": "md5sum.input" | ||
"ga4ghMd5.inputFile": "../md5sum.input" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import subprocess | ||
import unittest | ||
|
||
|
||
class TestMd5sumChecker(unittest.TestCase): | ||
# For each workflow, verify that it succeeds when the input file's md5sum matches and fails when it does not | ||
def test_cwl_success(self): | ||
process = subprocess.call(["cwltool", "checker-workflow-wrapping-tool.cwl", "checker-input-cwl.json"]) | ||
self.assertEqual(process, 0) | ||
|
||
def test_cwl_failure(self): | ||
process = subprocess.call(["cwltool", "checker-workflow-wrapping-tool.cwl", "checker-fail-cwl.json"]) | ||
self.assertEqual(process, 1) | ||
|
||
def test_wdl_success(self): | ||
process = subprocess.call(["java", "-jar", "cromwell-42.jar", "run", "checker-workflow-wrapping-workflow.wdl", | ||
"-i", "md5sum-wdl.json"]) | ||
self.assertEqual(process, 0) | ||
|
||
def test_wdl_failure(self): | ||
process = subprocess.call(["java", "-jar", "cromwell-42.jar", "run", "checker-workflow-wrapping-workflow.wdl", | ||
"-i", "md5sum-fail-wdl.json"]) | ||
self.assertEqual(process, 1) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |