コード例 #1
0
ファイル: blazemeter.py プロジェクト: davidli2017/taurus
 def startup(self):
     super(CloudProvisioning, self).startup()
     self.client.start_taurus(self.test_id)
     self.log.info("Started cloud test: %s", self.client.results_url)
     if self.client.results_url:
         if self.browser_open in ('start', 'both'):
             open_browser(self.client.results_url)
コード例 #2
0
ファイル: blazemeter.py プロジェクト: SanjeebJena/taurus
 def startup(self):
     super(CloudProvisioning, self).startup()
     self.client.start_taurus(self.test_id)
     self.log.info("Started cloud test: %s", self.client.results_url)
     if self.client.results_url:
         if self.browser_open in ('start', 'both'):
             open_browser(self.client.results_url)
コード例 #3
0
    def post_process(self):
        """
        Upload results if possible
        """
        if not self._session:
            self.log.debug("No feeding session obtained, nothing to finalize")
            return

        self.log.debug("KPI bulk buffer len in post-proc: %s",
                       len(self.kpi_buffer))
        try:
            self.log.info("Sending remaining KPI data to server...")
            if self.send_data:
                self.__send_data(self.kpi_buffer, False, True)
                self.kpi_buffer = []

            if self.send_monitoring:
                self.__send_monitoring()
        finally:
            self._postproc_phase2()

        if self.results_url:
            if self.browser_open in ('end', 'both'):
                open_browser(self.results_url)
            self.log.info("Online report link: %s", self.results_url)
コード例 #4
0
    def post_process(self):
        self.log.warning(
            'Part of result data might be missed here due to BM API specifics')

        if not self.detach and self.router and not self.test_ended:
            self.router.stop_test()

        if self.results_url:
            if self.browser_open in ('end', 'both'):
                open_browser(self.results_url)

        if self.router and self.router.master:
            full = self.router.master.get_full()
            if 'note' in full and full['note']:
                self.log.warning(
                    "Cloud test has probably failed with message: %s",
                    full['note'])

            for session in full.get('sessions', ()):
                for error in session.get("errors", ()):
                    raise TaurusException(to_json(error))

            if "hasThresholds" in full and full["hasThresholds"]:
                thresholds = self.router.master.get_thresholds()
                for item in thresholds.get('data', []):
                    if item.get('success', None) is False:
                        reason = None
                        for assertion in item.get('assertions', []):
                            if assertion.get('success', None) is False:
                                criterion = assertion.get('field', '')
                                label = assertion.get('label', '')
                                reason = "Cloud failure criterion %r (on label %r) was met" % (
                                    criterion, label)
                                break
                        if reason is None:
                            reason = "Cloud tests failed because failure criteria were met"
                        self.log.warning(reason)
                        raise AutomatedShutdown(reason)

            # if we have captured HARs, let's download them
            for service in self.engine.config.get(Service.SERV, []):
                mod = service.get(
                    'module',
                    TaurusConfigError("No 'module' specified for service"))
                assert isinstance(mod, str), mod
                module = self.engine.instantiate_module(mod)
                if isinstance(module, ServiceStubCaptureHAR):
                    self._download_logs()
                    break

            if "functionalSummary" in full:
                summary = full["functionalSummary"]
                if summary is None or summary.get("isFailed", False):
                    raise AutomatedShutdown("Cloud tests failed")
コード例 #5
0
    def post_process(self):
        """
        Upload results if possible
        """
        self.log.debug("KPI bulk buffer len in post-proc: %s",
                       len(self.kpi_buffer))
        self.log.info("Sending remaining KPI data to server...")
        self.__send_data(self.kpi_buffer, False, True)
        self.kpi_buffer = []

        if self.browser_open in ('end', 'both'):
            open_browser(self.results_url)
        self.log.info("Report link: %s", self.results_url)
コード例 #6
0
    def startup(self):
        super(CloudProvisioning, self).startup()
        self.results_url = self.router.launch_test()
        self.log.info("Started cloud test: %s", self.results_url)
        if self.results_url:
            if self.browser_open in ('start', 'both'):
                open_browser(self.results_url)

        if self.user.token and self.public_report:
            public_link = self.router.master.make_report_public()
            self.log.info("Public report link: %s", public_link)

        if self.report_name:
            self.router.master.set({"name": str(self.report_name)})
コード例 #7
0
    def startup(self):
        """
        Initiate online test
        """
        super(BlazeMeterUploader, self).startup()
        self._user.log = self.log.getChild(self.__class__.__name__)

        if not self._session:
            url = self._start_online()
            self.log.info("Started data feeding: %s", url)
            if self.browser_open in ('start', 'both'):
                open_browser(url)

            if self._user.token and self.public_report:
                report_link = self._master.make_report_public()
                self.log.info("Public report link: %s", report_link)
コード例 #8
0
    def startup(self):
        """
        Initiate online test
        """
        super(SignalfxUploader, self).startup()

        self.results_url = self._session.dashboard_url + \
                           '?startTime=-15m&endTime=Now' + \
                           '&sources%5B%5D=' + \
                           'project:' + \
                           self.project + \
                           '&sources%5B%5D=id:' + \
                           self.sess_id + \
                           '&density=4'

        self.log.info("Started data feeding: %s", self.results_url)
        if self.browser_open in ('start', 'both'):
            open_browser(self.results_url)
コード例 #9
0
ファイル: blazemeter.py プロジェクト: davidli2017/taurus
    def post_process(self):
        """
        Upload results if possible
        """
        if not self.client.active_session_id:
            self.log.debug("No feeding session obtained, nothing to finalize")
            return

        try:
            self.__send_data(self.kpi_buffer, False, True)
            self.kpi_buffer = []
        finally:
            self._postproc_phase2()

        if self.client.results_url:
            if self.browser_open in ('end', 'both'):
                open_browser(self.client.results_url)
            self.log.info("Online report link: %s", self.client.results_url)
コード例 #10
0
ファイル: blazemeter.py プロジェクト: davidli2017/taurus
    def startup(self):
        """
        Initiate online test
        """
        super(BlazeMeterUploader, self).startup()

        if not self.client.active_session_id:
            try:
                url = self.client.start_online(self.test_id, self.sess_name)
                self.log.info("Started data feeding: %s", url)
                if self.browser_open in ('start', 'both'):
                    open_browser(url)
            except KeyboardInterrupt:
                raise
            except BaseException as exc:
                self.log.debug("Exception: %s", traceback.format_exc())
                self.log.warning("Failed to start feeding: %s", exc)
                raise
コード例 #11
0
ファイル: blazemeter.py プロジェクト: SanjeebJena/taurus
    def startup(self):
        """
        Initiate online test
        """
        super(BlazeMeterUploader, self).startup()

        if not self.client.active_session_id:
            try:
                url = self.client.start_online(self.test_id, self.sess_name)
                self.log.info("Started data feeding: %s", url)
                if self.browser_open in ('start', 'both'):
                    open_browser(url)
            except KeyboardInterrupt:
                raise
            except BaseException as exc:
                self.log.debug("Exception: %s", traceback.format_exc())
                self.log.warning("Failed to start feeding: %s", exc)
                raise
コード例 #12
0
ファイル: blazemeter.py プロジェクト: SanjeebJena/taurus
    def post_process(self):
        """
        Upload results if possible
        """
        if not self.client.active_session_id:
            self.log.debug("No feeding session obtained, nothing to finalize")
            return

        try:
            self.__send_data(self.kpi_buffer, False, True)
            self.kpi_buffer = []
        finally:
            self._postproc_phase2()

        if self.client.results_url:
            if self.browser_open in ('end', 'both'):
                open_browser(self.client.results_url)
            self.log.info("Online report link: %s", self.client.results_url)
コード例 #13
0
ファイル: blazemeter.py プロジェクト: davidli2017/taurus
 def post_process(self):
     self.client.end_master(self.client.active_session_id)
     if self.client.results_url:
         if self.browser_open in ('end', 'both'):
             open_browser(self.client.results_url)
コード例 #14
0
ファイル: blazemeter.py プロジェクト: SanjeebJena/taurus
 def post_process(self):
     self.client.end_master(self.client.active_session_id)
     if self.client.results_url:
         if self.browser_open in ('end', 'both'):
             open_browser(self.client.results_url)