def testGetOldStdioUri_InternalOnly_NoURIReturned(self): testing_common.AddTests(['Master'], ['b'], {'my_suite': {}}) test = utils.TestKey('Master/b/my_suite').get() test.buildername = 'MyBuilder' row = graph_data.Row(id=345, buildnumber=456) test.masterid = 'my.master.id' test.internal_only = True self.assertIsNone(graph_json._GetOldStdioUri(row, test))
def testGetOldStdioUri_WithMasterId_URIReturned(self): testing_common.AddTests(['Master'], ['b'], {'my_suite': {}}) test = utils.TestKey('Master/b/my_suite').get() test.buildername = 'MyBuilder' row = graph_data.Row(id=345, buildnumber=456) test.masterid = 'my.master.id' self.assertEqual( ('http://build.chromium.org/p/my.master.id/builders/MyBuilder' '/builds/456/steps/my_suite/logs/stdio'), graph_json._GetOldStdioUri(row, test))
def testGetOldStdioUri_CustomPrefix_CustomPrefixUsed(self): testing_common.AddTests(['Master'], ['b'], {'my_suite': {}}) test = utils.TestKey('Master/b/my_suite').get() test.buildername = 'MyBuilder' row = graph_data.Row(id=345, buildnumber=456) test.masterid = 'my.master.id' test.internal_only = True # If the row has a custom prefix, that will be used, even if the test is # internal-only. row.a_stdio_uri_prefix = 'http://special-logs.chromium.org/x' self.assertEqual( ('http://special-logs.chromium.org/x/my.master.id/builders/MyBuilder' '/builds/456/steps/my_suite/logs/stdio'), graph_json._GetOldStdioUri(row, test))
def testGetOldStdioUri_CustomPrefix_CustomPrefixUsed(self): testing_common.AddTests(['Master'], ['b'], {'my_suite': {}}) test = utils.TestKey('Master/b/my_suite').get() test.buildername = 'MyBuilder' row = graph_data.Row(id=345, buildnumber=456) test.masterid = 'my.master.id' test.internal_only = True # If the row has a custom prefix, that will be used, even if the test is # internal-only. row.a_stdio_uri_prefix = 'http://special-logs.chromium.org/x' self.assertEqual(( 'http://special-logs.chromium.org/x/my.master.id/builders/MyBuilder' '/builds/456/steps/my_suite/logs/stdio'), graph_json._GetOldStdioUri(row, test))