Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py

Issue 809393002: Added support for improvement_direction to relevant values, which is propogated to chartjson. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix linter issues Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py
diff --git a/tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py b/tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py
index 4f1e0c130c7076dc5b5cc3a220c59d029696b8d2..9b7ed7133b015aae16b5edde36941463119b39be 100644
--- a/tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py
+++ b/tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py
@@ -9,6 +9,7 @@ from telemetry import page as page_module
from telemetry.page import page_set
from telemetry.results import csv_pivot_table_output_formatter
from telemetry.results import page_test_results
+from telemetry.value import improvement_direction
from telemetry.value import scalar
@@ -57,7 +58,9 @@ class CsvPivotTableOutputFormatterTest(unittest.TestCase):
def testSimple(self):
# Test a simple benchmark with only one value:
self.SimulateBenchmarkRun({
- self._page_set[0]: [scalar.ScalarValue(None, 'foo', 'seconds', 3)]})
+ self._page_set[0]: [scalar.ScalarValue(
+ None, 'foo', 'seconds', 3,
+ improvement_direction=improvement_direction.DOWN)]})
expected = self._LINE_SEPARATOR.join([
'page_set,page,name,value,units,run_index',
'page_set,http://www.foo.com/,foo,3,seconds,0',
@@ -67,10 +70,20 @@ class CsvPivotTableOutputFormatterTest(unittest.TestCase):
def testMultiplePagesAndValues(self):
self.SimulateBenchmarkRun({
- self._page_set[0]: [scalar.ScalarValue(None, 'foo', 'seconds', 4)],
- self._page_set[1]: [scalar.ScalarValue(None, 'foo', 'seconds', 3.4),
- scalar.ScalarValue(None, 'bar', 'km', 10),
- scalar.ScalarValue(None, 'baz', 'count', 5)]})
+ self._page_set[0]: [
+ scalar.ScalarValue(
+ None, 'foo', 'seconds', 4,
+ improvement_direction=improvement_direction.DOWN)],
+ self._page_set[1]: [
+ scalar.ScalarValue(
+ None, 'foo', 'seconds', 3.4,
+ improvement_direction=improvement_direction.DOWN),
+ scalar.ScalarValue(
+ None, 'bar', 'km', 10,
+ improvement_direction=improvement_direction.DOWN),
+ scalar.ScalarValue(
+ None, 'baz', 'count', 5,
+ improvement_direction=improvement_direction.DOWN)]})
# Parse CSV output into list of lists.
csv_string = self.Format()
@@ -84,8 +97,13 @@ class CsvPivotTableOutputFormatterTest(unittest.TestCase):
def testTraceTag(self):
self.MakeFormatter(trace_tag='date,option')
self.SimulateBenchmarkRun({
- self._page_set[0]: [scalar.ScalarValue(None, 'foo', 'seconds', 3),
- scalar.ScalarValue(None, 'bar', 'tons', 5)]})
+ self._page_set[0]: [
+ scalar.ScalarValue(
+ None, 'foo', 'seconds', 3,
+ improvement_direction=improvement_direction.DOWN),
+ scalar.ScalarValue(
+ None, 'bar', 'tons', 5,
+ improvement_direction=improvement_direction.DOWN)]})
output = self.Format().split(self._LINE_SEPARATOR)
self.assertTrue(output[0].endswith(',trace_tag_0,trace_tag_1'))

Powered by Google App Engine
This is Rietveld 408576698