Fix conversion to JS for HTML reports 59/65159/8
authorPatrice Buriez <patrice.buriez@intel.com>
Thu, 15 Nov 2018 11:30:30 +0000 (12:30 +0100)
committerPatrice Buriez <patrice.buriez@intel.com>
Fri, 21 Dec 2018 18:07:59 +0000 (19:07 +0100)
commitf85bca25fd5a681215c210c51b703e0e957a91e5
treeeca867f2731ba0b2da2c3d6a5c02c48cbb2fb1ef
parent285a0026d13173fb3bca4c74562874cb10641384
Fix conversion to JS for HTML reports

Some new fields in InfluxDB have plain text contents that AST cannot
parse as valid expressions, resulting in exceptions being raised by
yardstick CLI commands "report generate" and "report generate-nsb".

Reworked _generate_common() to properly handle and convert:
- unicode, str and missing keys
- None, unicode, str, float, long and int values
- float, long and int stored as unicode or str values

Added test__generate_common() unit test, to verify all possible
conversion flavors.

Also renamed incorrect "tasks" to "metrics".

Also fixed warning in Python3 for some unit tests, caused by
deprecation of unittest.TestCase.assertRaisesRegexp().

JIRA: YARDSTICK-1367
Topic: report/html_table (10 of 12)

Change-Id: Iff75bfd2c1dcaf3806f67f52f0ea594f10aceb5b
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
yardstick/benchmark/core/report.py
yardstick/tests/unit/benchmark/core/test_report.py