Пример #1
0
def test_taskcluster_service():
    """
    Test taskcluster service loader
    """
    taskcluster = TaskclusterConfig("http://tc.test")

    assert taskcluster.get_service("secrets") is not None
    assert taskcluster.get_service("hooks") is not None
    assert taskcluster.get_service("index") is not None
    with pytest.raises(AssertionError) as e:
        taskcluster.get_service("nope")
    assert str(e.value) == "Invalid Taskcluster service nope"
Пример #2
0
    def __init__(
        self,
        taskcluster_config: TaskclusterConfig,
        queue_name: str,
        emails: list,
        period: int,
    ):
        assert period > 0
        assert len(emails) > 0
        self.queue_name = queue_name
        self.period = period
        self.stats: Dict[str, Dict[str, List[str]]] = {}
        self.emails = emails

        # Setup Taskcluster services
        self.notify = taskcluster_config.get_service("notify", use_async=True)
        self.queue = taskcluster_config.get_service("queue", use_async=True)
        self.taskcluster_base_url = taskcluster_config.default_url
Пример #3
0
    def _is_queue_overloaded(provisioner_id: str, worker_type: str, acceptable_limit=100) -> bool:
        """
        Helper method for PerfSheriffBot to check load on processing queue.
        Usage example: _queue_is_too_loaded('gecko-3', 'b-linux')
        :return: True/False
        """
        tc = TaskclusterConfig('https://firefox-ci-tc.services.mozilla.com')
        tc.auth(client_id=CLIENT_ID, access_token=ACCESS_TOKEN)
        queue = tc.get_service('queue')

        pending_tasks_count = queue.pendingTasks(provisioner_id, worker_type).get('pendingTasks')

        return pending_tasks_count > acceptable_limit
Пример #4
0
# -*- coding: utf-8 -*-

# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import os

from taskcluster.helper import TaskclusterConfig

ARTIFACT_BASE = "project/fuzzing/bugmon/"

# Shared taskcluster configuration
taskcluster = TaskclusterConfig(os.environ["TASKCLUSTER_ROOT_URL"])
queue = taskcluster.get_service("queue")