def _run_tests(self, build, default_testrun_options):
        """Execute the tests for the given build"""

        cur_index = 0
        firstrun = True
        addons = self._config['addons']

        # Iterate in chunks over all extended add-ons
        while cur_index < len(addons['extended']):
            try:
                addon_set = copy.copy(addons['default'])
                if firstrun:
                    # For the first run we do only install the default add-ons
                    firstrun = False
                else:
                    # Otherwise retrieve the next number of extended add-ons
                    max_index = cur_index + self._config['settings']['addons_per_run']
                    addons_extended = addons['extended'][cur_index:max_index]
                    addon_set.extend(addons_extended)
                    cur_index += len(addons_extended)

                # Build testrun options for add-ons to test
                addon_options = [ ]
                tags = [ ]

                for addon in addon_set:
                    addon_options.append('--addons=%s' % addon['local_url'])
                    tags.append('--tag=%s' % addon['name'])

                # Install the specified build so we don't have to do it for
                # each individual testrun.
                install_path = tempfile.mkdtemp('.binary')
                folder = Installer().install(build, install_path)
                binary = application.get_binary('firefox', folder)

                # Setup all necessary testrun options to test the build
                testrun_options = copy.copy(default_testrun_options)
                testrun_options.append(binary)
                testrun_options.extend(addon_options)
                testrun_options.extend(tags)

                # Setup profile for testing
                profile_path = tempfile.mkdtemp(suffix='profile')
                testrun_options.append('--profile=' + profile_path)

                # Execute testruns
                self.execute_testrun(EnduranceTestRun, testrun_options)
                self.execute_testrun(UpdateTestRun, testrun_options, ['--no-fallback'])
                self.execute_testrun(EnduranceTestRun, testrun_options)

                # Ensure to remove the temporarily created profile
                shutil.rmtree(profile_path, True)

            finally:
                install.Installer().uninstall(folder)
Example #2
0
    def prepare_binary(self, binary):
        """ Prepare the binary for the test run. """

        if application.is_installer(self.options.application, binary):
            install_path = tempfile.mkdtemp(".binary")
            self._folder = install.Installer().install(binary, install_path)
            self._application = application.get_binary(self.options.application, self._folder)
        else:
            folder = os.path.dirname(binary)
            self._folder = folder if not os.path.isdir(binary) else binary
            self._application = binary
Example #3
0
    def prepare_binary(self, binary):
        """ Prepare the binary for the test run. """

        if application.is_installer(self.options.application, binary):
            install_path = tempfile.mkdtemp(".binary")
            self._folder = install.Installer().install(binary, install_path)
            self._application = application.get_binary(self.options.application, self._folder)
        else:
            folder = os.path.dirname(binary)
            self._folder = folder if not os.path.isdir(binary) else binary
            self._application = binary

        # Print application details
        ini = application.ApplicationIni(self._folder)
        print '*** Application: %s %s' % (
            ini.get('App', 'Name'),
            ini.get('App', 'Version'))