From 081daa9cff7f9c201b4296515f3d04810063c6fd Mon Sep 17 00:00:00 2001 From: Alexander Maretskiy Date: Thu, 15 Oct 2015 16:03:04 +0300 Subject: [PATCH] [Reports] Add an option for embedding JS/CSS libs into report This change allows running command `report' with `--html-static' option so all required JS/CSS will be embedded to HTML file. Having all required CSS/JS loaded directly from HTML makes report working without access to the Internet. Added third-party libraries files: rally/ui/templates/libs/nv.d3.1.1.15-beta.min.css rally/ui/templates/libs/angular.1.3.3.min.js rally/ui/templates/libs/nv.d3.1.1.15-beta.min.js rally/ui/templates/libs/d3.3.4.13.min.js Notes about licenses compatibility: https://angularjs.org/ https://github.com/angular/angular.js/blob/master/LICENSE The MIT License compatible with Apache License Version 2.0 according to http://www.apache.org/legal/resolved.html http://d3js.org/ https://github.com/mbostock/d3/blob/master/LICENSE BSD 3-clause License compatible with Apache License Version 2.0 according to http://www.apache.org/legal/resolved.html http://nvd3.org/ https://github.com/novus/nvd3/blob/master/LICENSE.md Apache License Version 2.0 Change-Id: I8913ecc585ee17affb1d8a0b29bb475c1e07427f Closes-Bug: #1505533 --- etc/rally.bash_completion | 2 +- tests/functional/test_cli_task.py | 51 +++++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/etc/rally.bash_completion b/etc/rally.bash_completion index 47baa485..521e8fec 100644 --- a/etc/rally.bash_completion +++ b/etc/rally.bash_completion @@ -39,7 +39,7 @@ _rally() OPTS["task_delete"]="--force --uuid" OPTS["task_detailed"]="--uuid --iterations-data" OPTS["task_list"]="--deployment --all-deployments --status --uuids-only" - OPTS["task_report"]="--tasks --out --open --html --junit" + OPTS["task_report"]="--tasks --out --open --html --html-static --junit" OPTS["task_results"]="--uuid" OPTS["task_sla_check"]="--uuid --json" OPTS["task_start"]="--deployment --task --task-args --task-args-file --tag --no-use --abort-on-sla-failure" diff --git a/tests/functional/test_cli_task.py b/tests/functional/test_cli_task.py index 574b2fe7..3adb9200 100644 --- a/tests/functional/test_cli_task.py +++ b/tests/functional/test_cli_task.py @@ -186,14 +186,28 @@ class TaskTestCase(unittest.TestCase): self.assertRaises(utils.RallyCliError, rally, "task status --uuid %s" % FAKE_TASK_UUID) + def _assert_html_report_libs_are_embedded(self, file_path, expected=True): + + embedded_signatures = ["Copyright (c) 2011-2014 Novus Partners, Inc.", + "AngularJS v1.3.3", + "Copyright (c) 2010-2015, Michael Bostock"] + external_signatures = ["