コード例 #1
0
    def _create_test_id():
        """return unified test-id

        Returns:
            str -- generated test-id for whole run.
        """
        # avoid cyclic-decencies between cluster and db_stats
        from sdcm.cluster import Setup

        return Setup.test_id()
コード例 #2
0
    def get_test_details(self):
        # avoid cyclic-decencies between cluster and db_stats
        from sdcm.cluster import Setup

        test_details = {}
        test_details['sct_git_commit'] = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip()
        test_details['job_name'] = get_job_name()
        test_details['job_url'] = os.environ.get('BUILD_URL', '')
        test_details['start_host'] = platform.node()
        test_details['test_duration'] = self.params.get(key='test_duration', default=60)
        test_details['start_time'] = time.time()
        test_details['grafana_snapshots'] = []
        test_details['grafana_screenshots'] = []
        test_details['grafana_annotations'] = []
        test_details['prometheus_data'] = ""
        test_details['test_id'] = Setup.test_id()
        test_details['log_files'] = {}
        return test_details
コード例 #3
0
    def _create_test_id(doc_id_with_timestamp=False):
        """Return doc_id equal unified test-id

        Generate doc_id for ES document as unified global test-id
        if doc_id_with_timestamp is true, create ES
        document with global test_id + timestamp

        :param doc_id_with_timestamp: add timestamp to test_id , defaults to False
        :type doc_id_with_timestamp: bool, optional
        :returns: doc_id for document in ES
        :rtype: {str}
        """
        # avoid cyclic-decencies between cluster and db_stats
        from sdcm.cluster import Setup
        doc_id = Setup.test_id()
        if doc_id_with_timestamp:
            doc_id += "_{}".format(datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f"))
        return doc_id