Permalink
Browse files

Fix a couple issues with producing test outputs.

  • Loading branch information...
jmchilton committed Oct 12, 2015
1 parent 5d7db92 commit 572e7545e17ccdb37087e208febafd86a913a282
Showing with 12 additions and 4 deletions.
  1. +9 −3 planemo/galaxy_test/actions.py
  2. +2 −0 planemo/reports/build_report.py
  3. +1 −1 planemo/reports/report_html.tpl
@@ -83,12 +83,18 @@ def run_in_config(ctx, config, **kwds):
test_data = test_results.structured_data

if 'test_output' in kwds:
with open(kwds['test_output'], 'w') as handle:
handle.write(build_report.build_report(test_data))
output_path = kwds['test_output']
if output_path is not None:
with open(output_path, 'w') as handle:
handle.write(build_report.build_report(test_data))

for kw_name in ('markdown', 'text'):
if 'test_output_%s' % kw_name in kwds:
with open(kwds['test_output_%s' % kw_name], 'w') as handle:
output_path = kwds['test_output_%s' % kw_name]
if output_path is None:
continue

with open(output_path, 'w') as handle:
handle.write(build_report.build_report(test_data, report_type=kw_name))

except Exception:
@@ -1,3 +1,4 @@
import json
from pkg_resources import resource_string
from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader('planemo', 'reports'))
@@ -20,6 +21,7 @@ def build_report(structured_data, report_type="html", **kwds):
'bootstrap_style': __style("bootstrap.min.css"),
'jquery_script': __script("jquery.min"),
'bootstrap_script': __script("bootstrap.min"),
'json': json,
})

return template_data(environment, 'report_%s.tpl' % report_type)
@@ -78,7 +78,7 @@
.success(function(content) { renderTestResults( $.parseJSON(content) ); })
.failure(function() { alert("Failed to load test data.")} );
} else {
var test_data = {{ raw_data | to_json }};
var test_data = {{ json.dumps(raw_data) }};
renderTestResults(test_data);
}
</script>

0 comments on commit 572e754

Please sign in to comment.