Beispiel #1
0
 def test_read(self):
     log_path = os.path.join(os.path.dirname(__file__), '..', 'resources',
                             'grinder', 'grinder-bzt-kpi.log')
     obj = DataLogReader(log_path, logging.getLogger(''))
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 20)
     self.assertIn('Test #1', list_of_values[-1][DataPoint.CUMULATIVE])
Beispiel #2
0
 def test_read_test_names(self):
     log_path = RESOURCES_DIR + 'grinder/grinder-bzt-1-kpi.log'
     obj = DataLogReader(log_path, ROOT_LOGGER)
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 21)
     self.assertIn('requests_sample',
                   list_of_values[-1][DataPoint.CUMULATIVE])
Beispiel #3
0
 def test_read_by_url(self):
     log_path = RESOURCES_DIR + 'grinder/grinder-bzt-kpi.log'
     obj = DataLogReader(log_path, logging.getLogger(''))
     obj.report_by_url = True
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 20)
     last = list_of_values[-1]
     self.assertIn('http://blazedemo.com/payment.php', last[DataPoint.CUMULATIVE].keys())
Beispiel #4
0
 def test_read_errors(self):
     log_path = os.path.join(os.path.dirname(__file__), '..', 'resources', 'grinder', 'grinder-bzt-1-kpi.log')
     obj = DataLogReader(log_path, logging.getLogger(''))
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 20)
     last = list_of_values[-1]
     self.assertEquals(1, len(last[DataPoint.CUMULATIVE][''][KPISet.ERRORS]))
     self.assertIn('Not Found', last[DataPoint.CUMULATIVE][''][KPISet.ERRORS][0]['msg'])
Beispiel #5
0
 def test_read_by_url(self):
     log_path = os.path.join(os.path.dirname(__file__), '..', 'resources', 'grinder', 'grinder-bzt-kpi.log')
     obj = DataLogReader(log_path, logging.getLogger(''))
     obj.report_by_url = True
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 20)
     last = list_of_values[-1]
     self.assertIn('http://blazedemo.com/payment.php', last[DataPoint.CUMULATIVE].keys())
Beispiel #6
0
    def test_read_errors(self):
        log_path = RESOURCES_DIR + 'grinder/grinder-bzt-1-kpi.log'
        obj = DataLogReader(log_path, logging.getLogger(''))
        list_of_values = list(obj.datapoints(True))
        self.assertEqual(len(list_of_values), 21)

        last = list_of_values[-1]
        self.assertEquals(2, len(last[DataPoint.CUMULATIVE][''][KPISet.ERRORS]))
        self.assertIn('Not Found', last[DataPoint.CUMULATIVE][''][KPISet.ERRORS][0]['msg'])
        self.assertIn('Java exception', last[DataPoint.CUMULATIVE][''][KPISet.ERRORS][1]['msg'])
Beispiel #7
0
 def test_read(self):
     log_path = os.path.join(os.path.dirname(__file__), '..', 'grinder',
                             'grinder-bzt-kpi.log')
     obj = DataLogReader(log_path, logging.getLogger(''))
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 10)
Beispiel #8
0
 def test_read_empty_kpi(self):
     log_path = RESOURCES_DIR + 'grinder/grinder.sh'
     obj = DataLogReader(log_path, ROOT_LOGGER)
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 0)
Beispiel #9
0
 def test_read(self):
     log_path = os.path.join(os.path.dirname(__file__), '..', 'grinder', 'grinder-bzt-kpi.log')
     obj = DataLogReader(log_path, logging.getLogger(''))
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 10)
Beispiel #10
0
 def test_read_test_names(self):
     log_path = RESOURCES_DIR + 'grinder/grinder-bzt-1-kpi.log'
     obj = DataLogReader(log_path, logging.getLogger(''))
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 21)
     self.assertIn('requests_sample', list_of_values[-1][DataPoint.CUMULATIVE])
Beispiel #11
0
 def test_read_empty_kpi(self):
     log_path = RESOURCES_DIR + 'grinder/grinder.sh'
     obj = DataLogReader(log_path, logging.getLogger(''))
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 0)
Beispiel #12
0
 def test_read(self):
     log_path = RESOURCES_DIR + 'grinder/grinder-bzt-kpi.log'
     obj = DataLogReader(log_path, logging.getLogger(''))
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 20)
     self.assertIn('Test #1', list_of_values[-1][DataPoint.CUMULATIVE])
Beispiel #13
0
 def test_read(self):
     log_path = RESOURCES_DIR + 'grinder/grinder-bzt-kpi.log'
     obj = DataLogReader(log_path, ROOT_LOGGER)
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 20)
     self.assertIn('Test #1', list_of_values[-1][DataPoint.CUMULATIVE])
Beispiel #14
0
 def test_read_empty_kpi(self):
     log_path = os.path.join(os.path.dirname(__file__), '..', 'resources',
                             'grinder', 'grinder.sh')
     obj = DataLogReader(log_path, logging.getLogger(''))
     list_of_values = list(obj.datapoints(True))
     self.assertEqual(len(list_of_values), 0)