def stdio_for_step(master_url, builder_name, build, step): # pragma: no cover # FIXME: Should get this from the step in some way? base_url = buildbot.build_url(master_url, builder_name, build['number']) stdio_url = '%s/steps/%s/logs/stdio/text' % (base_url, step['name']) try: return requests.get(stdio_url).text except requests.exceptions.ConnectionError, e: # Some builders don't save logs for whatever reason. logging.error('Failed to fetch %s: %s', stdio_url, e) return None
def test_build_url(self): url = buildbot.build_url('https://foo.com/p/bar', 'baz', '12') self.assertEquals(url, 'https://foo.com/p/bar/builders/baz/builds/12')