Ejemplo n.º 1
0
 def testTimeseries2_notFoundRaisesKeyError(self):
     self.mock_request.side_effect = TestResponse(404, 'Not found')
     with self.assertRaises(KeyError):
         dashboard_service.Timeseries2(
             test_suite='loading.mobile',
             measurement='timeToFirstContenrfulPaint',
             bot='ChromiumPerf:androd-go-perf',
             columns='revision,avg')
Ejemplo n.º 2
0
    def Process(test_path):
        try:
            if isinstance(test_path, tables.timeseries.Key):
                params = test_path.AsApiParams()
                params['min_timestamp'] = min_timestamp
                data = dashboard_service.Timeseries2(**params)
            else:
                data = dashboard_service.Timeseries(test_path, days=args.days)
        except KeyError:
            logging.info('Timeseries not found: %s', test_path)
            return

        timeseries = tables.timeseries.DataFrameFromJson(test_path, data)
        pandas_sqlite.InsertOrReplaceRecords(con, 'timeseries', timeseries)
Ejemplo n.º 3
0
 def testTimeseries2(self):
     response = dashboard_service.Timeseries2(
         test_suite='loading.mobile',
         measurement='timeToFirstContenrfulPaint',
         bot='ChromiumPerf:androd-go-perf',
         columns='revision,avg')
     self.assertEqual(response, 'OK')
     self.mock_request.assert_called_once_with(
         dashboard_service.SERVICE_URL + '/timeseries2',
         params={
             'test_suite': 'loading.mobile',
             'measurement': 'timeToFirstContenrfulPaint',
             'bot': 'ChromiumPerf:androd-go-perf',
             'columns': 'revision,avg'
         },
         method='POST',
         use_auth=True,
         accept='json')
Ejemplo n.º 4
0
 def testTimeseries2_missingArgsRaisesTypeError(self):
     with self.assertRaises(TypeError):
         dashboard_service.Timeseries2(
             test_suite='loading.mobile',
             measurement='timeToFirstContenrfulPaint')