Beispiel #1
0
def test_invalid_query_does_not_raise(httpd):
    """Invalid usage of the Treeherder wrapper."""
    th = Treeherder('firefox', 'mozilla-beta', 'invalid_platform',
                    server_url='http://{}:{}'.format(httpd.host, httpd.port))
    builds = th.query_builds_by_revision('29258f59e545')

    assert builds == []
Beispiel #2
0
    def test_invalid_query_does_not_raise(self):
        th = Treeherder('firefox', 'mozilla-beta', 'invalid_platform',
                        host='{}:{}'.format(self.httpd.host, self.httpd.port),
                        protocol='http')
        builds = th.query_builds_by_revision('29258f59e545')

        self.assertEqual(builds, [])
Beispiel #3
0
def test_query_tinderbox_builds(httpd, platform):
    """Basic tests for the Treeherder wrapper."""
    httpd.router.register('GET', '/api/*', handle_rest_api)

    if platform == 'mac64':
        pytest.skip("mac64 is identical to mac")

    application = 'firefox' if not platform.startswith('android') else 'mobile'
    th = Treeherder(application, 'mozilla-beta', platform,
                    server_url='http://{}:{}'.format(httpd.host, httpd.port))
    builds = th.query_builds_by_revision('29258f59e545')

    assert len(builds) == 1
    assert re.search(r'mozilla-beta-%s' % platform, builds[0].rsplit('/', 3)[1]) is not None
Beispiel #4
0
    def test_query_tinderbox_builds(self):
        self.httpd.router.register('GET', '/api/*', handle_rest_api)

        for platform in PLATFORM_MAP:
            # mac64 is identical to mac
            if platform == 'mac64':
                continue

            application = 'firefox' if not platform.startswith('android') else 'mobile'
            th = Treeherder(application, 'mozilla-beta', platform,
                            server_url='http://{}:{}'.format(self.httpd.host, self.httpd.port))
            builds = th.query_builds_by_revision('29258f59e545')

            self.assertEqual(len(builds), 1)
            self.assertRegexpMatches(builds[0].rsplit('/', 3)[1],
                                     r'mozilla-beta-%s' % platform)