コード例 #1
0
    def _get_mozreview(self, where):
        if not where:
            if 'MOZREVIEW_HOME' in os.environ:
                where = os.environ['MOZREVIEW_HOME']
            else:
                # Check for the path used by start-local-mozreview
                default_path = os.path.abspath(
                    os.path.join(HERE, '..', '..', '..', 'mozreview-test'))
                if os.path.isdir(default_path):
                    where = default_path

        web_image = os.environ.get('DOCKER_BMOWEB_IMAGE')
        hgrb_image = os.environ.get('DOCKER_HGRB_IMAGE')
        ldap_image = os.environ.get('DOCKER_LDAP_IMAGE')
        pulse_image = os.environ.get('DOCKER_PULSE_IMAGE')
        rbweb_image = os.environ.get('DOCKER_RBWEB_IMAGE')
        autolanddb_image = os.environ.get('DOCKER_AUTOLANDDB_IMAGE')
        autoland_image = os.environ.get('DOCKER_AUTOLAND_IMAGE')
        hgweb_image = os.environ.get('DOCKER_HGWEB_IMAGE')
        treestatus_image = os.environ.get('DOCKER_TREESTATUS_IMAGE')

        from vcttesting.mozreview import MozReview
        return MozReview(where, web_image=web_image,
                         hgrb_image=hgrb_image, ldap_image=ldap_image,
                         pulse_image=pulse_image, rbweb_image=rbweb_image,
                         autolanddb_image=autolanddb_image,
                         autoland_image=autoland_image,
                         hgweb_image=hgweb_image,
                         treestatus_image=treestatus_image)
コード例 #2
0
    def __init__(self, context):
        if 'BUGZILLA_URL' in os.environ:
            self.base_url = os.environ['BUGZILLA_URL']
            username = os.environ['BUGZILLA_USERNAME']
            password = os.environ['BUGZILLA_PASSWORD']

            self.b = Bugzilla(self.base_url,
                              username=username,
                              password=password)

        elif 'MOZREVIEW_HOME' in os.environ:
            mr = MozReview(os.environ['MOZREVIEW_HOME'])
            username = os.environ.get('BUGZILLA_USERNAME')
            password = os.environ.get('BUGZILLA_PASSWORD')

            self.b = mr.get_bugzilla(username=username, password=password)

        else:
            raise Exception(
                'Do not know which Bugzilla instance to talk to. '
                'Set BUGZILLA_URL or MOZREVIEW_HOME environment variables.')
コード例 #3
0
    def setUpClass(cls):
        if 'SKIP_DOCKER_TESTS' in os.environ:
            raise unittest.SkipTest('Skipping tests that require Docker')

        tmpdir = tempfile.mkdtemp()
        cls._tmpdir = tmpdir

        try:
            mr = MozReview(tmpdir)
        except DockerNotAvailable:
            raise unittest.SkipTest('Docker not available')

        cls.mr = mr

        # If this fails mid-operation, we could have some services running.
        # unittest doesn't call tearDownClass if setUpClass fails. So do it
        # ourselves.
        try:
            start_mozreview(mr)
        except Exception:
            mr.stop()
            shutil.rmtree(tmpdir)
            raise
コード例 #4
0
    def __init__(self, context):
        if 'BUGZILLA_URL' in os.environ:
            self.base_url = os.environ['BUGZILLA_URL']
            username = os.environ['BUGZILLA_USERNAME']
            password = os.environ['BUGZILLA_PASSWORD']

            self.b = Bugzilla(self.base_url,
                              username=username,
                              password=password)

        elif 'MOZREVIEW_HOME' in os.environ:
            # Delay import to facilitate module use in limited virtualenvs.
            from vcttesting.mozreview import MozReview

            mr = MozReview(os.environ['MOZREVIEW_HOME'])
            username = os.environ.get('BUGZILLA_USERNAME')
            password = os.environ.get('BUGZILLA_PASSWORD')

            self.b = mr.get_bugzilla(username=username, password=password)

        else:
            raise Exception(
                'Do not know which Bugzilla instance to talk to. '
                'Set BUGZILLA_URL or MOZREVIEW_HOME environment variables.')
コード例 #5
0
 def __init__(self, context):
     from vcttesting.mozreview import MozReview
     if 'MOZREVIEW_HOME' in os.environ:
         self.mr = MozReview(os.environ['MOZREVIEW_HOME'])
     else:
         self.mr = None