-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test_report command for rebuilding reports from structured JSON.
Refactor Galaxy testing abstractions toward better exception handling (print more, fail harder, try more - if one report type fails try the others but still throw an exception at the end) and toward greater reuse without being a full test context (i.e. try to be able to do more from just json).
- Loading branch information
Showing
9 changed files
with
346 additions
and
48 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
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,24 @@ | ||
import os | ||
|
||
import click | ||
|
||
from planemo.cli import pass_context | ||
from planemo import io | ||
from planemo import options | ||
from planemo.galaxy_test import StructuredData, handle_test_reports | ||
|
||
|
||
@click.command('test_reports') | ||
@options.tool_test_json() | ||
@options.test_report_options() | ||
@pass_context | ||
def cli(ctx, path, **kwds): | ||
"""Generate various tool test reports (HTML, text, markdown) from | ||
structure output from tests (tool_test_output.json). | ||
""" | ||
if not os.path.exists(path): | ||
io.error("Failed to tool test json file at %s" % path) | ||
return 1 | ||
|
||
test_data = StructuredData(path) | ||
handle_test_reports(ctx, test_data, **kwds) |
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,6 @@ | ||
from .actions import run_in_config | ||
from .structures import StructuredData | ||
from .actions import handle_test_reports | ||
|
||
__all__ = ["run_in_config"] | ||
|
||
__all__ = ["run_in_config", "StructuredData", "handle_test_reports"] |
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
Oops, something went wrong.
exit_code
is already an attribute ofGalaxyTestResults
class, defined in the__init__()
method. Now instantiating an object of this class fails withAttributeError: can't set attribute
.