Permalink
Browse files

Fix #331.

 - Fully resolve report paths before passing to Galaxy, this used to be done by click before I wanted fancier defaults (falling back to .planemo.yml for instance).
 - Make warning about Galaxy version more clear.
  • Loading branch information...
jmchilton committed Oct 22, 2015
1 parent 1e1585a commit 19900a6f61b41db9807063e57f1c776ce8c1cb1c
Showing with 15 additions and 8 deletions.
  1. +5 −2 planemo/config.py
  2. +3 −1 planemo/galaxy_test/structures.py
  3. +7 −5 planemo/options.py
@@ -6,15 +6,18 @@
}


def get_default_callback(default, name=None):
def get_default_callback(default, name=None, resolve_path=False):

def callback(ctx, param, value):
planemo_ctx = ctx.obj
config_name = name
if config_name is None:
config_name = param.name

return _default_option(planemo_ctx, config_name, value, default)
result = _default_option(planemo_ctx, config_name, value, default)
if resolve_path and result:
result = os.path.abspath(result)
return result

return callback

@@ -7,6 +7,8 @@
import json
import xml.etree.ElementTree as ET

from planemo.io import error

RUN_TESTS_CMD = (
"sh run_tests.sh --report_file %s %s %s %s"
)
@@ -62,7 +64,7 @@ def __init__(self, json_path):
structured_data = json.load(output_json_f)
structured_data_tests = structured_data["tests"]
except Exception:
print("Warning: Targetting older Galaxy which did not "
error("Warning: Targetting older Galaxy which did not "
"produce a structured test results files.")
structured_data = {}
structured_data_tests = {}
@@ -585,37 +585,39 @@ def test_options():
click.option(
"--test_output",
type=click.Path(file_okay=True, resolve_path=True),
callback=get_default_callback("tool_test_output.html"),
callback=get_default_callback("tool_test_output.html",
resolve_path=True),
help=("Output test report (HTML - for humans) defaults to "
"tool_test_output.html."),
default=None,
),
click.option(
"--test_output_text",
type=click.Path(file_okay=True, resolve_path=True),
callback=get_default_callback(None),
callback=get_default_callback(None, resolve_path=True),
help=("Output test report (Basic text - for display in CI)"),
default=None,
),
click.option(
"--test_output_markdown",
type=click.Path(file_okay=True, resolve_path=True),
callback=get_default_callback(None),
callback=get_default_callback(None, resolve_path=True),
help=("Output test report (Markdown style - for humans & "
"computers)"),
default=None,
),
click.option(
"--test_output_xunit",
type=click.Path(file_okay=True, resolve_path=True),
callback=get_default_callback(None),
callback=get_default_callback(None, resolve_path=True),
help="Output test report (xUnit style - for computers).",
default=None,
),
click.option(
"--test_output_json",
type=click.Path(file_okay=True, resolve_path=True),
callback=get_default_callback("tool_test_output.json"),
callback=get_default_callback("tool_test_output.json",
resolve_path=True),
help=("Output test report (planemo json) defaults to "
"tool_test_output.json."),
default=None,

0 comments on commit 19900a6

Please sign in to comment.