def testFetchSuites_AllDeprecatedBots(self): self._AddSampleData() # For another test suite, set it as deprecated on both bots -- it should # be marked as deprecated in the response dict. for bot in ['win7', 'mac']: test = utils.TestKey('Chromium/%s/really' % bot).get() test.deprecated = True test.UpdateSheriff() test.put() self.assertEqual( { 'dromaeo': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'scrolling': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'really': { 'dep': True, 'mas': {'Chromium': {'mac': True, 'win7': True}} }, }, update_test_suites._CreateTestSuiteDict())
def testFetchSuites_MultipleMonitored(self): self._AddSampleData() testing_common.AddTests( ['ChromiumFYI'], ['linux'], { 'dromaeo': { 'foo': {}, }, } ) self.assertEqual( { 'dromaeo': { 'mas': { 'Chromium': {'mac': False, 'win7': False}, 'ChromiumFYI': {'linux': False} }, }, 'scrolling': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'really': { 'mas': {'Chromium': {'mac': False, 'win7': False}} }, }, update_test_suites._CreateTestSuiteDict())
def testFetchSuites_DifferentMasters(self): # If the cache is not set at all, then FetchCachedTestSuites # just updates the cache before returning the list. self._AddSampleData() testing_common.AddTests( ['ChromiumFYI'], ['linux'], { 'sunspider': { 'Total': {}, }, } ) self.assertEqual( { 'dromaeo': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'scrolling': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'really': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'sunspider': {'mas': {'ChromiumFYI': {'linux': False}}}, }, update_test_suites._CreateTestSuiteDict())
def testCreateTestSuitesDict(self): self._AddSampleData() # For one test suite, add a monitored test and set the suite as deprecated. # Only set it as deprecated on one of two bots; this test suite should not # be marked as deprecated in the response dict, but only the non-deprecated # bot (mac in the this sample data) should be listed. test = utils.TestKey("Chromium/win7/dromaeo").get() test.monitored = [utils.TestKey("Chromium/win7/dromaeo/commit_time/www.yahoo.com")] test.put() # For another test suite, set it as deprecated on both bots -- it should # be marked as deprecated in the response dict. for bot in ["win7", "mac"]: test = utils.TestKey("Chromium/%s/really" % bot).get() test.deprecated = True test.put() # Set the description string for two test suites on both bots. It doesn't # matter whether this description is set for both bots or just one. for test_path in ["Chromium/win7/scrolling", "Chromium/mac/scrolling"]: test = utils.TestKey(test_path).get() test.description = "Description string." test.put() self.assertEqual( { "dromaeo": {"mas": {"Chromium": {"mac": False, "win7": False}}, "mon": ["commit_time/www.yahoo.com"]}, "scrolling": {"mas": {"Chromium": {"mac": False, "win7": False}}, "des": "Description string."}, "really": {"dep": True, "mas": {"Chromium": {"mac": True, "win7": True}}}, }, update_test_suites._CreateTestSuiteDict(), )
def testFetchSuites_BasicMonitored(self): self._AddSampleData() self.assertEqual( { 'dromaeo': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } }, }, 'scrolling': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } }, }, 'really': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } } }, }, update_test_suites._CreateTestSuiteDict())
def testFetchSuites_MultipleMonitored(self): self._AddSampleData() testing_common.AddTests( ['ChromiumFYI'], ['linux'], { 'dromaeo': { 'foo': {}, }, } ) self.assertEqual( { 'dromaeo': { 'mas': { 'Chromium': {'mac': False, 'win7': False}, 'ChromiumFYI': {'linux': False} }, }, 'scrolling': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'really': { 'mas': {'Chromium': {'mac': False, 'win7': False}} }, }, update_test_suites._CreateTestSuiteDict())
def testFetchSuites_DifferentMasters(self): # If the cache is not set at all, then FetchCachedTestSuites # just updates the cache before returning the list. self._AddSampleData() testing_common.AddTests( ['ChromiumFYI'], ['linux'], { 'sunspider': { 'Total': {}, }, } ) self.assertEqual( { 'dromaeo': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'scrolling': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'really': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'sunspider': {'mas': {'ChromiumFYI': {'linux': False}}}, }, update_test_suites._CreateTestSuiteDict())
def testFetchSuites_BasicMonitored(self): self._AddSampleData() test = utils.TestKey('Chromium/win7/dromaeo').get() test.monitored = [utils.TestKey('Chromium/win7/dromaeo/dom')] test.put() self.assertEqual( { 'dromaeo': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } }, 'mon': ['dom'] }, 'scrolling': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } }, }, 'really': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } } }, }, update_test_suites._CreateTestSuiteDict())
def testCreateTestSuitesDict(self): self._AddSampleData() # For one test suite, add a monitored test and set the suite as deprecated. # Only set it as deprecated on one of two bots; this test suite should not # be marked as deprecated in the response dict, but only the non-deprecated # bot (mac in the this sample data) should be listed. test = utils.TestKey('Chromium/win7/dromaeo').get() test.monitored = [ utils.TestKey('Chromium/win7/dromaeo/commit_time/www.yahoo.com') ] test.put() # For another test suite, set it as deprecated on both bots -- it should # be marked as deprecated in the response dict. for bot in ['win7', 'mac']: test = utils.TestKey('Chromium/%s/really' % bot).get() test.deprecated = True test.put() # Set the description string for two test suites on both bots. It doesn't # matter whether this description is set for both bots or just one. for test_path in ['Chromium/win7/scrolling', 'Chromium/mac/scrolling']: test = utils.TestKey(test_path).get() test.description = 'Description string.' test.put() self.assertEqual( { 'dromaeo': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } }, 'mon': ['commit_time/www.yahoo.com'], }, 'scrolling': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } }, 'des': 'Description string.', }, 'really': { 'dep': True, 'mas': { 'Chromium': { 'mac': True, 'win7': True } } }, }, update_test_suites._CreateTestSuiteDict())
def testFetchSuites_MultipleMonitored(self): self._AddSampleData() testing_common.AddTests(['ChromiumFYI'], ['linux'], { 'dromaeo': { 'foo': {}, }, }) test = utils.TestKey('Chromium/win7/dromaeo').get() test.monitored = [utils.TestKey('Chromium/win7/dromaeo/dom')] test.put() test = utils.TestKey('Chromium/mac/dromaeo').get() test.monitored = [ utils.TestKey('Chromium/win7/dromaeo/dom'), utils.TestKey('Chromium/win7/dromaeo/jslib') ] test.put() test = utils.TestKey('ChromiumFYI/linux/dromaeo').get() test.monitored = [ utils.TestKey('ChromiumFYI/linux/dromaeo/dom'), utils.TestKey('ChromiumFYI/linux/dromaeo/foo') ] test.put() self.assertEqual( { 'dromaeo': { 'mas': { 'Chromium': { 'mac': False, 'win7': False }, 'ChromiumFYI': { 'linux': False } }, 'mon': ['dom', 'foo', 'jslib'] }, 'scrolling': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } }, }, 'really': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } } }, }, update_test_suites._CreateTestSuiteDict())
def testCreateTestSuitesDict(self): self._AddSampleData() # For one test suite, add a monitored test and set the suite as deprecated. # Only set it as deprecated on one of two bots; this test suite should not # be marked as deprecated in the response dict, but only the non-deprecated # bot (mac in the this sample data) should be listed. test = utils.TestKey('Chromium/win7/dromaeo').get() test.monitored = [utils.TestKey( 'Chromium/win7/dromaeo/commit_time/www.yahoo.com')] test.put() # For another test suite, set it as deprecated on both bots -- it should # be marked as deprecated in the response dict. for bot in ['win7', 'mac']: test = utils.TestKey('Chromium/%s/really' % bot).get() test.deprecated = True test.put() # Set the description string for two test suites on both bots. It doesn't # matter whether this description is set for both bots or just one. for test_path in ['Chromium/win7/scrolling', 'Chromium/mac/scrolling']: test = utils.TestKey(test_path).get() test.description = 'Description string.' test.put() print update_test_suites._CreateTestSuiteDict() self.assertEqual( { 'dromaeo': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, 'mon': ['commit_time/www.yahoo.com'], }, 'scrolling': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, 'des': 'Description string.', }, 'really': { 'dep': True, 'mas': {'Chromium': {'mac': True, 'win7': True}} }, }, update_test_suites._CreateTestSuiteDict())
def testFetchSuites_BasicMonitored(self): self._AddSampleData() self.assertEqual( { 'dromaeo': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'scrolling': { 'mas': {'Chromium': {'mac': False, 'win7': False}}, }, 'really': { 'mas': {'Chromium': {'mac': False, 'win7': False}} }, }, update_test_suites._CreateTestSuiteDict())
def testFetchSuites_AllDeprecatedBots(self): self._AddSampleData() # For another test suite, set it as deprecated on both bots -- it should # be marked as deprecated in the response dict. for bot in ['win7', 'mac']: test = utils.TestKey('Chromium/%s/really' % bot).get() test.deprecated = True test.UpdateSheriff() test.put() self.assertEqual( { 'dromaeo': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } }, }, 'scrolling': { 'mas': { 'Chromium': { 'mac': False, 'win7': False } }, }, 'really': { 'dep': True, 'mas': { 'Chromium': { 'mac': True, 'win7': True } } }, }, update_test_suites._CreateTestSuiteDict())