Esempio n. 1
0
 def test_versions_repo_and_revision_check(self, result):
     """test_versions method
     Tests if the indicated branch and revision repo exists
     """
     log.info("Testing repo and revision in tree ...")
     try:
         make_hg_get_request(self.repo_path, self.revision).strip()
     except requests.HTTPError as err:
         err_msg = "{path} repo does not exist with {rev} revision. URL: {url}".format(
             path=self.repo_path, rev=self.revision, url=err.request.url)
         result.add_error(err_msg, sys.exc_info())
Esempio n. 2
0
 def test_versions_repo_and_revision_check(self, result):
     """test_versions method
     Tests if the indicated branch and revision repo exists
     """
     log.info("Testing repo and revision in tree ...")
     try:
         make_hg_get_request(self.repo_path, self.revision).strip()
     except requests.HTTPError as err:
         err_msg = "{path} repo does not exist with {rev} revision. URL: {url}".format(
             path=self.repo_path, rev=self.revision, url=err.request.url)
         result.add_error(err_msg, sys.exc_info())
Esempio n. 3
0
    def test_versions_display_validation_in_tree(self, result):
        """test_versions method
        Tests if the upstream display version exists and if it is the same
        with the current one coming from release runner
        """
        log.info("Testing version display validation in tree ...")
        version = self.version
        if '52.' in version:
            # esr-hack: ensure trimming the suffix before comparing, for < esr60
            version = self.version.replace("esr", "")

        try:
            display_version = make_hg_get_request(
                self.repo_path,
                self.revision,
                filename=VERSION_DISPLAY_CONFIG_URI[self.product],
            ).strip()
        except requests.HTTPError as err:
            err_msg = ("display_version config file not found in {path} under"
                       " {rev} revision. URL: {url}").format(
                           path=self.repo_path,
                           rev=self.revision,
                           url=err.request.url)
            result.add_error(err_msg, sys.exc_info())
            return

        err_msg = ("In-tree display version {tree_version} doesn't "
                   "match ship-it version {version}").format(
                       tree_version=display_version, version=version)
        self.assertEqual(result, version, display_version, err_msg)
Esempio n. 4
0
    def test_l10n_shipped_locales(self, result):
        """test_l10n method
        Tests if the current locales coming from release runner are in fact
        the same as the shipped locales.
        """
        log.info("Testing l10n shipped locales ...")
        try:
            # TODO: mind that we will need something similar for Fennec
            ret = make_hg_get_request(self.repo_path, self.revision,
                                      filename=SHIPPED_LOCALES_CONFIG_URI).strip()
        except requests.HTTPError as err:
            err_msg = ("Shipped locale file not found in {path} repo under rev"
                       " {revision}. URL: {url}").format(
                           path=self.repo_path,
                           revision=self.revision,
                           url=err.request.url)
            result.add_error(err_msg, sys.exc_info())
            return

        shipped_l10n = set([l.split()[0] for l in ret.splitlines()])
        current_l10n = set(self.locales.keys())

        err_msg = "Current l10n changesets and shipped locales differ!"
        # we have en-US in shipped locales, but not in l10n changesets, because
        # there is no en-US repo
        self.assertEqual(result, shipped_l10n.difference(current_l10n),
                         set(['en-US']),
                         err_msg)
        self.assertEqual(result, current_l10n.difference(shipped_l10n),
                         set([]),
                         err_msg)
Esempio n. 5
0
    def test_versions_display_validation_in_tree(self, result):
        """test_versions method
        Tests if the upstream display version exists and if it is the same
        with the current one coming from release runner
        """
        log.info("Testing version display validation in tree ...")
        version = self.version
        if '52.' in version:
            # esr-hack: ensure trimming the suffix before comparing, for < esr60
            version = self.version.replace("esr", "")

        try:
            display_version = make_hg_get_request(
                self.repo_path, self.revision,
                filename=VERSION_DISPLAY_CONFIG_URI[self.product],
            ).strip()
        except requests.HTTPError as err:
            err_msg = ("display_version config file not found in {path} under"
                       " {rev} revision. URL: {url}").format(
                           path=self.repo_path,
                           rev=self.revision,
                           url=err.request.url)
            result.add_error(err_msg, sys.exc_info())
            return

        err_msg = ("In-tree display version {tree_version} doesn't "
                   "match ship-it version {version}").format(
                       tree_version=display_version, version=version)
        self.assertEqual(result, version, display_version, err_msg)
Esempio n. 6
0
def get_single_locale_config(repo_path, revision, branch):
    """Get single locale from remote mh configs
    Example for mozilla-beta, random revision:

    >>>
    config = {
        "nightly_build": True,
        "branch": "mozilla-beta",
        ...
        # l10n
        "hg_l10n_base": "https://hg.mozilla.org/releases/l10n/mozilla-beta",
        # repositories
        "mozilla_dir": "mozilla-beta",
        'purge_minsize': 12,
        'is_automation': True,
        ...
    }
    """
    filename = SINGLE_LOCALE_CONFIG_URI_TEMPLATE.format(branch=branch)
    return make_hg_get_request(repo_path, revision, filename=filename)