Beispiel #1
0
    def __init__(self, revision, cache_root, client_id, access_token):
        # List of test-suite, sorted alphabetically.
        # This way, the index of a suite in the array should be stable enough.
        self.suites = [
            'cppunit',
            'gtest',
            'web-platform-tests',
            'talos',
        ]

        self.cache_root = cache_root

        assert os.path.isdir(cache_root), 'Cache root {} is not a dir.'.format(
            cache_root)
        self.repo_dir = os.path.join(cache_root, 'mozilla-central')

        self.client_id = client_id
        self.access_token = access_token

        self.githubUtils = GitHubUtils(cache_root, client_id, access_token)

        if revision is None:
            # Retrieve revision of latest codecov build
            github_revision = uploader.get_latest_codecov()
            self.revision = self.githubUtils.get_mercurial(github_revision)
            self.from_pulse = False
            suites_to_ignore = []
        else:
            self.revision = revision
            self.from_pulse = True
            suites_to_ignore = ['awsy', 'talos']
            self.notifier = Notifier(revision, client_id, access_token)

        logger.info('Mercurial revision', revision=self.revision)

        task_ids = {
            'linux':
            taskcluster.get_task('mozilla-central', self.revision, 'linux'),
            'windows':
            taskcluster.get_task('mozilla-central', self.revision, 'win'),
        }

        self.artifactsHandler = ArtifactsHandler(task_ids, suites_to_ignore)
Beispiel #2
0
def test_get_commit(GITHUB_COMMIT, MERCURIAL_COMMIT):
    gu = GitHubUtils('', '', '')
    assert gu.get_commit(MERCURIAL_COMMIT) == GITHUB_COMMIT
Beispiel #3
0
def test_get_mercurial(GITHUB_COMMIT, MERCURIAL_COMMIT):
    gu = GitHubUtils('', '', '')
    assert gu.get_mercurial(GITHUB_COMMIT) == MERCURIAL_COMMIT