Title: [185031] trunk/Tools
Revision
185031
Author
rn...@webkit.org
Date
2015-05-30 01:52:28 -0700 (Sat, 30 May 2015)

Log Message

Unreviewed build fix after r185014. Some tests only have subtests and not metrics.

* Scripts/webkitpy/benchmark_runner/benchmark_results.py:
(BenchmarkResults._lint_subtest_results):
* Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py:
(test_aggregate_nested_results):
(test_lint_results):
* WinLauncher/WinLauncher.vcxproj/WinLauncherResource.h:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (185030 => 185031)


--- trunk/Tools/ChangeLog	2015-05-30 03:55:15 UTC (rev 185030)
+++ trunk/Tools/ChangeLog	2015-05-30 08:52:28 UTC (rev 185031)
@@ -1,3 +1,14 @@
+2015-05-30  Ryosuke Niwa  <rn...@webkit.org>
+
+        Unreviewed build fix after r185014. Some tests only have subtests and not metrics.
+
+        * Scripts/webkitpy/benchmark_runner/benchmark_results.py:
+        (BenchmarkResults._lint_subtest_results):
+        * Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py:
+        (test_aggregate_nested_results):
+        (test_lint_results):
+        * WinLauncher/WinLauncher.vcxproj/WinLauncherResource.h:
+
 2015-05-29  Ryosuke Niwa  <rn...@webkit.org>
 
         run-benchmark should print out the results

Modified: trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py (185030 => 185031)


--- trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py	2015-05-30 03:55:15 UTC (rev 185030)
+++ trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py	2015-05-30 08:52:28 UTC (rev 185031)
@@ -179,22 +179,23 @@
     def _lint_subtest_results(cls, subtests, parent_needing_aggregation):
         iteration_groups_by_config = {}
         for test_name, test in subtests.iteritems():
-            if 'metrics' not in test:
-                raise TypeError('"%s" does not contain metrics' % test_name)
+            needs_aggregation = False
 
-            metrics = test['metrics']
-            if not isinstance(metrics, dict):
-                raise TypeError('The metrics in "%s" is not a dictionary' % test_name)
+            if 'metrics' not in test and 'tests' not in test:
+                raise TypeError('"%s" does not contain metrics or tests' % test_name)
 
-            needs_aggregation = False
-            for metric_name, metric in metrics.iteritems():
-                if isinstance(metric, list):
-                    cls._lint_aggregator_list(test_name, metric_name, metric)
-                    needs_aggregation = True
-                elif isinstance(metric, dict):
-                    cls._lint_configuration(test_name, metric_name, metric, parent_needing_aggregation, iteration_groups_by_config)
-                else:
-                    raise TypeError('"%s" metric of "%s" was not an aggregator list or a dictionary of configurations: %s' % (metric_name, test_name, str(metric)))
+            if 'metrics' in test:
+                metrics = test['metrics']
+                if not isinstance(metrics, dict):
+                    raise TypeError('The metrics in "%s" is not a dictionary' % test_name)
+                for metric_name, metric in metrics.iteritems():
+                    if isinstance(metric, list):
+                        cls._lint_aggregator_list(test_name, metric_name, metric)
+                        needs_aggregation = True
+                    elif isinstance(metric, dict):
+                        cls._lint_configuration(test_name, metric_name, metric, parent_needing_aggregation, iteration_groups_by_config)
+                    else:
+                        raise TypeError('"%s" metric of "%s" was not an aggregator list or a dictionary of configurations: %s' % (metric_name, test_name, str(metric)))
 
             if 'tests' in test:
                 cls._lint_subtest_results(test['tests'], test_name if needs_aggregation else None)

Modified: trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py (185030 => 185031)


--- trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py	2015-05-30 03:55:15 UTC (rev 185030)
+++ trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py	2015-05-30 08:52:28 UTC (rev 185031)
@@ -195,7 +195,7 @@
                     'SubTest2': {'metrics': {'Time': {None: {'current': [5, 6]}}}, 'tests': {}}}}})
 
     def test_lint_results(self):
-        with self.assertRaisesRegexp(TypeError, r'"SomeTest" does not contain metrics'):
+        with self.assertRaisesRegexp(TypeError, r'"SomeTest" does not contain metrics or tests'):
             BenchmarkResults._lint_results({'SomeTest': {}})
 
         with self.assertRaisesRegexp(TypeError, r'The metrics in "SomeTest" is not a dictionary'):
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to