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

Unified Diff: telemetry/telemetry/internal/results/chart_json_output_formatter_unittest.py

Issue 2342023005: Outputting chart json for disabled tests. (Closed)
Patch Set: Setting arg explicitly Created 4 years, 3 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: telemetry/telemetry/internal/results/chart_json_output_formatter_unittest.py
diff --git a/telemetry/telemetry/internal/results/chart_json_output_formatter_unittest.py b/telemetry/telemetry/internal/results/chart_json_output_formatter_unittest.py
index ddbb692cfdd3f47c549889385c01652ce8a566d9..1c4e646d5d39af4495c968aeba849ad4047a73ce 100644
--- a/telemetry/telemetry/internal/results/chart_json_output_formatter_unittest.py
+++ b/telemetry/telemetry/internal/results/chart_json_output_formatter_unittest.py
@@ -49,6 +49,12 @@ class ChartJsonTest(unittest.TestCase):
d = json.loads(self._output.getvalue())
self.assertIn('foo', d['charts'])
+ def testOutputAndParseDisabled(self):
+ self._formatter.FormatDisabled()
+ d = json.loads(self._output.getvalue())
+ self.assertEquals(d['benchmark_name'], 'benchmark_name')
+ self.assertFalse(d['enabled'])
+
def testAsChartDictSerializable(self):
v0 = scalar.ScalarValue(self._story_set[0], 'foo', 'seconds', 3,
improvement_direction=improvement_direction.DOWN)
@@ -76,6 +82,7 @@ class ChartJsonTest(unittest.TestCase):
self.assertEquals(d['benchmark_metadata']['description'],
'benchmark_description')
self.assertEquals(d['benchmark_metadata']['type'], 'telemetry_benchmark')
+ self.assertTrue(d['enabled'])
def testAsChartDictNoDescription(self):
page_specific_values = []
@@ -105,6 +112,7 @@ class ChartJsonTest(unittest.TestCase):
self.assertTrue('MyIR@@foo' in d['charts'])
self.assertTrue('http://www.foo.com/' in d['charts']['MyIR@@foo'])
+ self.assertTrue(d['enabled'])
def testAsChartDictPageSpecificValuesSamePageWithoutInteractionRecord(self):
v0 = scalar.ScalarValue(self._story_set[0], 'foo', 'seconds', 3,
@@ -121,6 +129,7 @@ class ChartJsonTest(unittest.TestCase):
self.assertTrue('foo' in d['charts'])
self.assertTrue('http://www.foo.com/' in d['charts']['foo'])
+ self.assertTrue(d['enabled'])
def testAsChartDictPageSpecificValuesAndComputedSummaryWithTraceName(self):
v0 = scalar.ScalarValue(self._story_set[0], 'foo.bar', 'seconds', 3,
@@ -139,6 +148,7 @@ class ChartJsonTest(unittest.TestCase):
self.assertTrue('http://www.foo.com/' in d['charts']['foo'])
self.assertTrue('http://www.bar.com/' in d['charts']['foo'])
self.assertTrue('bar' in d['charts']['foo'])
+ self.assertTrue(d['enabled'])
def testAsChartDictPageSpecificValuesAndComputedSummaryWithoutTraceName(self):
v0 = scalar.ScalarValue(self._story_set[0], 'foo', 'seconds', 3,
@@ -157,6 +167,7 @@ class ChartJsonTest(unittest.TestCase):
self.assertTrue('http://www.foo.com/' in d['charts']['foo'])
self.assertTrue('http://www.bar.com/' in d['charts']['foo'])
self.assertTrue('summary' in d['charts']['foo'])
+ self.assertTrue(d['enabled'])
def testAsChartDictSummaryValueWithTraceName(self):
v0 = list_of_scalar_values.ListOfScalarValues(
@@ -171,6 +182,7 @@ class ChartJsonTest(unittest.TestCase):
summary_values)
self.assertTrue('bar' in d['charts']['foo'])
+ self.assertTrue(d['enabled'])
def testAsChartDictSummaryValueWithoutTraceName(self):
v0 = list_of_scalar_values.ListOfScalarValues(
@@ -185,6 +197,7 @@ class ChartJsonTest(unittest.TestCase):
summary_values)
self.assertTrue('summary' in d['charts']['foo'])
+ self.assertTrue(d['enabled'])
def testAsChartDictWithTraceValuesThatHasTirLabel(self):
v = trace.TraceValue(self._story_set[0], trace_data.TraceData({'test': 1}))
@@ -198,6 +211,7 @@ class ChartJsonTest(unittest.TestCase):
self.assertTrue('trace' in d['charts'])
self.assertTrue('http://www.foo.com/' in d['charts']['trace'],
msg=d['charts']['trace'])
+ self.assertTrue(d['enabled'])
def testAsChartDictValueSmokeTest(self):
v0 = list_of_scalar_values.ListOfScalarValues(

Powered by Google App Engine
This is Rietveld 408576698