OLD | NEW |
---|---|
1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import datetime | 5 import datetime |
6 import unittest | 6 import unittest |
7 | 7 |
8 import webapp2 | 8 import webapp2 |
9 import webtest | 9 import webtest |
10 | 10 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 self.assertItemsEqual(bots, ['linux']) | 119 self.assertItemsEqual(bots, ['linux']) |
120 self.assertTrue(self.GetJsonValue(response, 'monitored')) | 120 self.assertTrue(self.GetJsonValue(response, 'monitored')) |
121 alerts = self.GetJsonValue(response, 'alerts') | 121 alerts = self.GetJsonValue(response, 'alerts') |
122 self.assertEqual(3, len(alerts)) | 122 self.assertEqual(3, len(alerts)) |
123 | 123 |
124 def testPost_Benchmark_NotMonitored(self): | 124 def testPost_Benchmark_NotMonitored(self): |
125 self._AddCachedSuites() | 125 self._AddCachedSuites() |
126 self._AddTests() | 126 self._AddTests() |
127 response = self.testapp.post( | 127 response = self.testapp.post( |
128 '/benchmark_health_report', { | 128 '/benchmark_health_report', { |
129 'benchmark': 'page_cycler', | 129 'benchmark': 'speedometer', |
sullivan
2017/02/23 03:32:25
The previous code was able to figure out that sinc
| |
130 'num_days': '30', | 130 'num_days': '30', |
131 'master': 'ChromiumPerf', | 131 'master': 'ChromiumPerf', |
132 }) | 132 }) |
133 self.assertFalse(self.GetJsonValue(response, 'monitored')) | 133 self.assertFalse(self.GetJsonValue(response, 'monitored')) |
134 | 134 |
135 def testPost_BenchmarkArgumentNumDaysArgument_ListsCorrectAlerts(self): | 135 def testPost_BenchmarkArgumentNumDaysArgument_ListsCorrectAlerts(self): |
136 self._AddCachedSuites() | 136 self._AddCachedSuites() |
137 self._AddSheriff(['*/*/page_cycler/*', '*/*/page_cycler/*/*']) | 137 self._AddSheriff(['*/*/page_cycler/*', '*/*/page_cycler/*/*']) |
138 self._AddTests() | 138 self._AddTests() |
139 self._AddAnomalyEntities( | 139 self._AddAnomalyEntities( |
(...skipping 13 matching lines...) Expand all Loading... | |
153 {'benchmark': 'page_cycler', 'num_days': '5', 'master': 'ChromiumPerf'}) | 153 {'benchmark': 'page_cycler', 'num_days': '5', 'master': 'ChromiumPerf'}) |
154 bots = self.GetJsonValue(response, 'bots') | 154 bots = self.GetJsonValue(response, 'bots') |
155 self.assertItemsEqual(bots, ['linux']) | 155 self.assertItemsEqual(bots, ['linux']) |
156 self.assertTrue(self.GetJsonValue(response, 'monitored')) | 156 self.assertTrue(self.GetJsonValue(response, 'monitored')) |
157 alerts = self.GetJsonValue(response, 'alerts') | 157 alerts = self.GetJsonValue(response, 'alerts') |
158 self.assertEqual(2, len(alerts)) | 158 self.assertEqual(2, len(alerts)) |
159 | 159 |
160 | 160 |
161 if __name__ == '__main__': | 161 if __name__ == '__main__': |
162 unittest.main() | 162 unittest.main() |
OLD | NEW |