Ejemplo n.º 1
0
 def testTestResultsDataFrame_wrongVersionRejected(self):
   data = {
       'android-bot': {
           'some': ['new', 'fancy', 'results', 'encoding']
       },
       'version': 5
   }
   with self.assertRaises(AssertionError):
     frames.TestResultsDataFrame(data)
Ejemplo n.º 2
0
 def testTestResultsDataFrame_empty(self):
   data = {
       'android-bot': {
           'secondsSinceEpoch': [1234567892, 1234567891, 1234567890],
           'buildNumbers': [42, 41, 40],
           'chromeRevision': [1234, 1233, 1232],
           'tests': {}
       },
       'version': 4
   }
   df = frames.TestResultsDataFrame(data)
   # The data frame is empty.
   self.assertTrue(df.empty)
   # Column names are still defined (although of course empty).
   six.assertCountEqual(self, df['test_case'].unique(), [])
Ejemplo n.º 3
0
 def testTestResultsDataFrame(self):
   data = {
       'android-bot': {
           'secondsSinceEpoch': [1234567892, 1234567891, 1234567890],
           'buildNumbers': [42, 41, 40],
           'chromeRevision': [1234, 1233, 1232],
           'tests': {
               'some_benchmark': {
                   'story_1': {
                       'results': [[3, 'P']],
                       'times': [[3, 1]]
                   },
                   'story_2': {
                       'results': [[2, 'Q']],
                       'times': [[2, 5]]
                   }
               },
               'another_benchmark': {
                   'story_3': {
                       'results': [[1, 'Q'], [2, 'P']],
                       'times': [[1, 3], [1, 2], [1, 3]]
                   }
               }
           }
       },
       'version': 4
   }
   df = frames.TestResultsDataFrame(data)
   # Poke and check a few simple facts about our sample data.
   # We have data from 3 builds x 3 stories:
   self.assertEqual(len(df), 9)
   # All run on the same bot.
   self.assertTrue((df['builder'] == 'android-bot').all())
   # The most recent build number was 42.
   self.assertEqual(df['build_number'].max(), 42)
   # some_benchmark/story_1 passed on all builds.
   selection = df[df['test_case'] == 'story_1']
   self.assertTrue((selection['test_suite'] == 'some_benchmark').all())
   self.assertTrue((selection['result'] == 'P').all())
   # There was no data for story_2 on build 40.
   selection = df[(df['test_case'] == 'story_2') & (df['build_number'] == 40)]
   self.assertEqual(len(selection), 1)
   self.assertTrue(selection.iloc[0]['result'], 'N')
Ejemplo n.º 4
0
 def make_frame():
     data = api.GetTestResults(master, builder, test_type)
     return frames.TestResultsDataFrame(data)