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)
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>

No differences found