Beispiel #1
0
    def start_test_metrics(self, class_name, test_name, test_description=None):
        """Creates a new Metrics object and starts reporting to it.  Useful
        for creating metrics for individual tests.
        """

        test_description = test_description or "No Test description."
        self.metrics.total_tests += 1
        self.test_metrics = TestRunMetrics()
        self.test_metrics.timer.start()
        root_log_dir = os.environ['CAFE_ROOT_LOG_PATH']
        self.stats_log = PBStatisticsLog(
            "{0}.{1}.statistics.csv".format(class_name, test_name),
            "{0}/statistics/".format(root_log_dir))

        log_info_block(self.logger.log,
                       [('Test Case', test_name),
                        ('Created At', self.metrics.timer.start_time),
                        (test_description, '')])
Beispiel #2
0
    def setUp(self):
        # Setup the timer and other custom init jazz
        self.fixture_metrics.total_tests += 1
        self.test_metrics = TestRunMetrics()
        self.test_metrics.timer.start()

        # Log header information
        self.fixture_log.info("{0}".format('=' * 56))
        self.fixture_log.info("Test Case.: {0}".format(self._testMethodName))
        self.fixture_log.info("Created.At: {0}".format(
            self.test_metrics.timer.start_time))
        if self.shortDescription():
            self.fixture_log.info("{0}".format(self.shortDescription()))
        self.fixture_log.info("{0}".format('=' * 56))
        ''' @todo: Get rid of this hard coded value for the statistics '''
        # set up the stats log
        self.stats_log = PBStatisticsLog(
            "{0}.statistics.csv".format(self._testMethodName),
            "{0}/../statistics/".format(engine_config.log_directory))

        # Let the base handle whatever hoodoo it needs
        unittest.TestCase.setUp(self)
Beispiel #3
0
    def setUp(self):
        self.shortDescription()

        # Setup the timer and other custom init jazz
        self.fixture_metrics.total_tests += 1
        self.test_metrics = TestRunMetrics()
        self.test_metrics.timer.start()

        # Log header information
        self.fixture_log.info("{0}".format('=' * 56))
        self.fixture_log.info("Test Case.: {0}".format(self._testMethodName))
        self.fixture_log.info("Created.At: {0}".format(
            self.test_metrics.timer.start_time))
        self.fixture_log.info("{0}".format(self.logDescription()))
        self.fixture_log.info("{0}".format('=' * 56))
        """ @todo: Get rid of this hard coded value for the statistics """
        # set up the stats log
        root_log_dir = os.environ['CAFE_ROOT_LOG_PATH']
        self.stats_log = PBStatisticsLog(
            "{0}.statistics.csv".format(self._testMethodName),
            "{0}/statistics/".format(root_log_dir))

        # Let the base handle whatever hoodoo it needs
        unittest.TestCase.setUp(self)