Spaces Data

Minimal test - lines (106, 118)

path: .spaces[0].spaces[2].metrics.mi.mi_visual_studio
old: 59.975301457577366
new: 59.2170021217228

path: .spaces[0].spaces[2].metrics.mi.mi_original
old: 102.55776549245728
new: 101.261073628146

path: .spaces[0].spaces[2].metrics.mi.mi_sei
old: 93.9832894957066
new: 99.03654009914834

path: .spaces[0].spaces[2].metrics.loc.sloc
old: 12.0
new: 13.0

path: .spaces[0].spaces[2].metrics.loc.cloc
old: 1.0
new: 2.0

Code

    def package_multi(self):
        dirs = self.query_abs_dirs()
        objdir = dirs["abs_obj_dir"]

        # This will error on non-0 exit code.
        locales = list(sorted(self.query_locales()))
        self._run_mach_command(["package-multi-locale", "--locales"] + locales)

        command = "make package-tests AB_CD=multi"
        self.run_command(
            command, cwd=objdir, error_list=MakefileErrorList, halt_on_failure=True
        )
        # TODO deal with buildsymbols

Minimal test - lines (24, 118)

path: .spaces[0].metrics.loc.cloc
old: 6.0
new: 7.0

path: .spaces[0].metrics.loc.sloc
old: 94.0
new: 95.0

path: .spaces[0].metrics.mi.mi_sei
old: 28.7150208540565
new: 29.80573298186641

path: .spaces[0].metrics.mi.mi_original
old: 58.80159789776325
new: 58.63016772660853

path: .spaces[0].metrics.mi.mi_visual_studio
old: 34.3868993554171
new: 34.286647793338325

Code

class MultiLocaleBuild(LocalesMixin, MercurialScript):
    """This class targets Fennec multilocale builds.
    We were considering this for potential Firefox desktop multilocale.
    Now that we have a different approach for B2G multilocale,
    it's most likely misnamed."""

    config_options = [
        [
            ["--locale"],
            {
                "action": "extend",
                "dest": "locales",
                "type": "string",
                "help": "Specify the locale(s) to repack",
            },
        ],
        [
            ["--objdir"],
            {
                "action": "store",
                "dest": "objdir",
                "type": "string",
                "default": "objdir",
                "help": "Specify the objdir",
            },
        ],
        [
            ["--l10n-base"],
            {
                "action": "store",
                "dest": "hg_l10n_base",
                "type": "string",
                "help": "Specify the L10n repo base directory",
            },
        ],
        [
            ["--l10n-tag"],
            {
                "action": "store",
                "dest": "hg_l10n_tag",
                "type": "string",
                "help": "Specify the L10n tag",
            },
        ],
        [
            ["--tag-override"],
            {
                "action": "store",
                "dest": "tag_override",
                "type": "string",
                "help": "Override the tags set for all repos",
            },
        ],
    ]

    def __init__(self, require_config_file=True):
        LocalesMixin.__init__(self)
        MercurialScript.__init__(
            self,
            config_options=self.config_options,
            all_actions=["pull-locale-source", "package-multi", "summary"],
            require_config_file=require_config_file,
        )

    # pull_locale_source() defined in LocalesMixin.

    def _run_mach_command(self, args):
        dirs = self.query_abs_dirs()

        mach = [sys.executable, "mach"]

        return_code = self.run_command(
            command=mach + ["--log-no-times"] + args,
            cwd=dirs["abs_src_dir"],
        )

        if return_code:
            self.fatal(
                "'mach %s' did not run successfully. Please check "
                "log for errors." % " ".join(args)
            )

    def package_multi(self):
        dirs = self.query_abs_dirs()
        objdir = dirs["abs_obj_dir"]

        # This will error on non-0 exit code.
        locales = list(sorted(self.query_locales()))
        self._run_mach_command(["package-multi-locale", "--locales"] + locales)

        command = "make package-tests AB_CD=multi"
        self.run_command(
            command, cwd=objdir, error_list=MakefileErrorList, halt_on_failure=True
        )
        # TODO deal with buildsymbols