| Index: dashboard/dashboard/pinpoint/handlers/new_test.py
|
| diff --git a/dashboard/dashboard/pinpoint/handlers/new_test.py b/dashboard/dashboard/pinpoint/handlers/new_test.py
|
| index f8984079fcc7942dbae3e73a252b27facd9544d7..876fd54ab07c7959eb04e660e154c33182c493a5 100644
|
| --- a/dashboard/dashboard/pinpoint/handlers/new_test.py
|
| +++ b/dashboard/dashboard/pinpoint/handlers/new_test.py
|
| @@ -17,6 +17,7 @@ from dashboard.common import utils
|
| from dashboard.services import gitiles_service
|
| from dashboard.pinpoint.handlers import new
|
| from dashboard.pinpoint.models import job as job_module
|
| +from dashboard.pinpoint.models import test_config
|
|
|
| AUTHORIZED_USER = users.User(email='authorized_person@chromium.org',
|
| _auth_domain='google.com')
|
| @@ -88,9 +89,9 @@ class NewTest(testing_common.TestCase):
|
| ]
|
| params = {
|
| 'configuration': 'chromium-rel-mac11-pro',
|
| - 'test_suite': 'speedometer',
|
| - 'test': '',
|
| - 'metric': 'Total',
|
| + 'target': 'telemetry_perf_tests',
|
| + 'dimensions': '{}',
|
| + 'benchmark': 'speedometer',
|
| 'auto_explore': '1',
|
| 'bug_id': 12345,
|
| 'start_repository': 'src',
|
| @@ -105,12 +106,12 @@ class NewTest(testing_common.TestCase):
|
| result['jobUrl'],
|
| 'https://testbed.example.com/job/%s' % result['jobId'])
|
|
|
| - def testPost_MetricButNoTestSuite(self):
|
| + def testPost_InvalidTestConfig(self):
|
| params = {
|
| 'configuration': 'chromium-rel-mac11-pro',
|
| - 'test_suite': '',
|
| - 'test': '',
|
| - 'metric': 'Total',
|
| + 'target': 'telemetry_perf_tests',
|
| + 'dimensions': '{}',
|
| + # telemetry_perf_tests requires a benchmark field, which is missing.
|
| 'auto_explore': '1',
|
| 'bug_id': 12345,
|
| 'start_repository': 'src',
|
| @@ -119,18 +120,15 @@ class NewTest(testing_common.TestCase):
|
| 'end_git_hash': '3'
|
| }
|
| response = self.testapp.post('/api/new', params, status=200)
|
| - self.assertEqual({'error': new._ERROR_METRIC_NO_TEST_SUITE},
|
| + self.assertEqual({'error': test_config._ERROR_NO_BENCHMARK},
|
| json.loads(response.body))
|
|
|
| @mock.patch.object(
|
| gitiles_service, 'CommitInfo',
|
| - mock.MagicMock(side_effect=gitiles_service.NotFoundError))
|
| + mock.MagicMock(side_effect=gitiles_service.NotFoundError('message')))
|
| def testPost_InvalidChange(self):
|
| params = {
|
| 'configuration': 'chromium-rel-mac11-pro',
|
| - 'test_suite': 'speedometer',
|
| - 'test': '',
|
| - 'metric': 'Total',
|
| 'auto_explore': '1',
|
| 'bug_id': 12345,
|
| 'start_repository': 'src',
|
| @@ -139,15 +137,12 @@ class NewTest(testing_common.TestCase):
|
| 'end_git_hash': '3'
|
| }
|
| response = self.testapp.post('/api/new', params, status=200)
|
| - self.assertEqual({'error': 'NotFoundError()'},
|
| + self.assertEqual({'error': 'message'},
|
| json.loads(response.body))
|
|
|
| def testPost_InvalidBug(self):
|
| params = {
|
| 'configuration': 'chromium-rel-mac11-pro',
|
| - 'test_suite': 'speedometer',
|
| - 'test': '',
|
| - 'metric': 'Total',
|
| 'auto_explore': '1',
|
| 'bug_id': 'not_an_int',
|
| 'start_repository': 'src',
|
| @@ -173,9 +168,6 @@ class NewTest(testing_common.TestCase):
|
| ]
|
| params = {
|
| 'configuration': 'chromium-rel-mac11-pro',
|
| - 'test_suite': 'speedometer',
|
| - 'test': '',
|
| - 'metric': 'Total',
|
| 'auto_explore': '1',
|
| 'bug_id': '',
|
| 'start_repository': 'src',
|
|
|