def _after_rendezvous(self):
        ''' After rendezvous actions '''

        # TODO Make this function more robust wrt unexpected errors

        #
        # This function is invoked both when the rendezvous fails
        # and succeeds.  If it succeeds, OK we have fresh information
        # on available tests and updates and we use it.  Otherwise,
        # if rendezvous fails, we may either have old information, or
        # no information, if this is the first rendezvous.  In any
        # case, we do our best to use the available information.
        #

        logging.info('background_rendezvous: automatic rendezvous... done')

        # Inform the user when we have updates
        new_version = RUNNER_UPDATES.get_update_version()
        new_uri = RUNNER_UPDATES.get_update_uri()
        if new_version and new_uri and not CONFIG['win32_updater']:
            logging.info('runner_rendezvous: version %s available at %s',
                         new_version, new_uri)
            STATE.update('update', {'version': new_version,
                                    'uri': new_uri})
            self._open_browser_on_windows('update.html')

        #
        # Choose the test we would like to run even if
        # we're not going to run it because tests are
        # disabled.  So we can print the test name also
        # when tests are disabled.
        #
        test = RUNNER_TESTS.get_next_test()
        if not test:
            logging.warning('background_rendezvous: no test available')
            self._schedule()
            return

        logging.info('background_rendezvous: chosen test: %s', test)

        # Are we allowed to run a test?
        if not CONFIG['enabled']:
            logging.info('background_rendezvous: automatic tests are disabled')
            self._schedule()
            return

        # Actually run the test
        RUNNER_CORE.run(test, self._schedule)
Пример #2
0
    def _after_rendezvous(self):
        ''' After rendezvous actions '''

        #
        # If rendezvous fails, RUNNER_UPDATES and RUNNER_TESTS
        # may be empty.  In such case, this function becomes just
        # a no operation and nothing happens.
        #

        # Inform the user when we have updates
        new_version = RUNNER_UPDATES.get_update_version()
        new_uri = RUNNER_UPDATES.get_update_uri()
        if new_version and new_uri:
            logging.info("Version %s available at %s", new_version, new_uri)
            STATE.update("update", {"version": new_version,
                                    "uri": new_uri})
            _open_browser_on_windows('update.html')

        #
        # Choose the test we would like to run even if
        # we're not going to run it because we're running
        # in debug mode or tests are disabled.
        # This allows us to print to the logger the test
        # we /would/ have choosen if we were allowed to
        # run tests.
        #
        test = RUNNER_TESTS.get_next_test()
        if not test:
            logging.warning("No test available")
            self._schedule()
            return

        logging.info("* Chosen test: %s", test)

        # Are we allowed to run a test?
        if not CONFIG["enabled"]:
            logging.info("Tests are disabled... not running")
            self._schedule()
            return

        # Actually run the test
        RUNNER_CORE.run(test, self._schedule)