-
Notifications
You must be signed in to change notification settings - Fork 101
More generalized planemo testing enhancements. #491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jmchilton
merged 9 commits into
galaxyproject:master
from
jmchilton:galaxy_style_testing_syntax
Jun 15, 2016
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cf5e059
Fix for output json.
jmchilton 4b14e62
Fix test report ID parsing for non-Galaxy tool artifacts.
jmchilton b2135cb
More testing of outputs - now using galaxy-lib...
jmchilton c21f0ba
More generalized planemo testing enhancements.
jmchilton dcd8f57
docfix thanks to eagle eyes @nsoranzo.
jmchilton 73e6a3c
Rev galaxy-lib for latest testing enhacements.
jmchilton 5c1002c
Fixup run options for the addition to engine to serve.
jmchilton a16b2ed
Rev galaxy-lib for latest cwltool changes.
jmchilton 6c2e169
Work on planemo for workflows slides.
jmchilton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,9 @@ | ||
| #!planemo test | ||
| - doc: test generated from example command | ||
| job: | ||
| input1: | ||
| class: File | ||
| value: test-data/2.fastq | ||
| outputs: | ||
| output1: | ||
| path: test-data/2.fasta |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 +1,7 @@ | ||
| """Module contains code for testing runnables.""" | ||
|
|
||
| from .check_output import check_output | ||
|
|
||
| __all__ = [ | ||
| 'check_output', | ||
| ] |
This file contains hidden or 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,51 @@ | ||
| """Check an output file from a generalize artifact test.""" | ||
| from galaxy.tools.verify import verify | ||
|
|
||
| import os | ||
|
|
||
|
|
||
| def check_output(runnable, output_properties, test_properties, **kwds): | ||
| """Use galaxy-lib to check a test output. | ||
|
|
||
| Return a list of strings describing the problems encountered, | ||
| and empty list indicates no problems were detected. | ||
|
|
||
| Currently this will only ever return at most one detected problem because | ||
| of the way galaxy-lib throws exceptions instead of returning individual | ||
| descriptions - but this may be enhanced in the future. | ||
| """ | ||
| get_filename = _test_filename_getter(runnable) | ||
| path = output_properties["path"] | ||
| output_content = open(path, "rb").read() | ||
| expected_file = test_properties.get("file", None) | ||
| job_output_files = kwds.get("job_output_files", None) | ||
| item_label = "Output with path %s" % path | ||
| problems = [] | ||
| try: | ||
| verify( | ||
| item_label, | ||
| output_content, | ||
| attributes=test_properties, | ||
| filename=expected_file, | ||
| get_filename=get_filename, | ||
| keep_outputs_dir=job_output_files, | ||
| verify_extra_files=None, | ||
| ) | ||
| except AssertionError as e: | ||
| problems.append(str(e)) | ||
|
|
||
| return problems | ||
|
|
||
|
|
||
| def _test_filename_getter(runnable): | ||
|
|
||
| def get_filename(name): | ||
| artifact_directory = os.path.dirname(runnable.path) | ||
| return os.path.join(artifact_directory, name) | ||
|
|
||
| return get_filename | ||
|
|
||
|
|
||
| __all__ = [ | ||
| "check_output", | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/file actual tool file/actual tool file/