Skip to content

Commit 19900a6

Browse files
committed
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.
1 parent 1e1585a commit 19900a6

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

planemo/config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
}
77

88

9-
def get_default_callback(default, name=None):
9+
def get_default_callback(default, name=None, resolve_path=False):
1010

1111
def callback(ctx, param, value):
1212
planemo_ctx = ctx.obj
1313
config_name = name
1414
if config_name is None:
1515
config_name = param.name
1616

17-
return _default_option(planemo_ctx, config_name, value, default)
17+
result = _default_option(planemo_ctx, config_name, value, default)
18+
if resolve_path and result:
19+
result = os.path.abspath(result)
20+
return result
1821

1922
return callback
2023

planemo/galaxy_test/structures.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import json
88
import xml.etree.ElementTree as ET
99

10+
from planemo.io import error
11+
1012
RUN_TESTS_CMD = (
1113
"sh run_tests.sh --report_file %s %s %s %s"
1214
)
@@ -62,7 +64,7 @@ def __init__(self, json_path):
6264
structured_data = json.load(output_json_f)
6365
structured_data_tests = structured_data["tests"]
6466
except Exception:
65-
print("Warning: Targetting older Galaxy which did not "
67+
error("Warning: Targetting older Galaxy which did not "
6668
"produce a structured test results files.")
6769
structured_data = {}
6870
structured_data_tests = {}

planemo/options.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,37 +585,39 @@ def test_options():
585585
click.option(
586586
"--test_output",
587587
type=click.Path(file_okay=True, resolve_path=True),
588-
callback=get_default_callback("tool_test_output.html"),
588+
callback=get_default_callback("tool_test_output.html",
589+
resolve_path=True),
589590
help=("Output test report (HTML - for humans) defaults to "
590591
"tool_test_output.html."),
591592
default=None,
592593
),
593594
click.option(
594595
"--test_output_text",
595596
type=click.Path(file_okay=True, resolve_path=True),
596-
callback=get_default_callback(None),
597+
callback=get_default_callback(None, resolve_path=True),
597598
help=("Output test report (Basic text - for display in CI)"),
598599
default=None,
599600
),
600601
click.option(
601602
"--test_output_markdown",
602603
type=click.Path(file_okay=True, resolve_path=True),
603-
callback=get_default_callback(None),
604+
callback=get_default_callback(None, resolve_path=True),
604605
help=("Output test report (Markdown style - for humans & "
605606
"computers)"),
606607
default=None,
607608
),
608609
click.option(
609610
"--test_output_xunit",
610611
type=click.Path(file_okay=True, resolve_path=True),
611-
callback=get_default_callback(None),
612+
callback=get_default_callback(None, resolve_path=True),
612613
help="Output test report (xUnit style - for computers).",
613614
default=None,
614615
),
615616
click.option(
616617
"--test_output_json",
617618
type=click.Path(file_okay=True, resolve_path=True),
618-
callback=get_default_callback("tool_test_output.json"),
619+
callback=get_default_callback("tool_test_output.json",
620+
resolve_path=True),
619621
help=("Output test report (planemo json) defaults to "
620622
"tool_test_output.json."),
621623
default=None,

0 commit comments

Comments
 (0)