def test_read_gatling302(self): log_path = RESOURCES_DIR + "gatling/" obj = DataLogReader(log_path, ROOT_LOGGER, 'gatling-302') # regular one list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 1) self.assertEqual(obj.guessed_gatling_version, "3.X") self.assertIn('group2', list_of_values[-1][DataPoint.CUMULATIVE].keys())
def test_read_labels_regular(self): log_path = RESOURCES_DIR + "gatling/" obj = DataLogReader(log_path, ROOT_LOGGER, 'gatling-3') # regular one list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 10) self.assertEqual(obj.guessed_gatling_version, "2.2+") self.assertIn('http://blazedemo.com/', list_of_values[-1][DataPoint.CUMULATIVE].keys())
def test_read_220_format(self): log_path = RESOURCES_DIR + "gatling/" obj = DataLogReader(log_path, ROOT_LOGGER, 'gatling-220') list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 4) self.assertEqual(obj.guessed_gatling_version, "2.2+") self.assertIn('/', list_of_values[-1][DataPoint.CUMULATIVE].keys())
def test_read_group(self): log_path = RESOURCES_DIR + "gatling/" obj = DataLogReader(log_path, ROOT_LOGGER, 'gatling-4') # regular one list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 179) self.assertEqual(obj.guessed_gatling_version, "2.2+") last_cumul = list_of_values[-1][DataPoint.CUMULATIVE] self.assertEqual(2, len(last_cumul['[empty]'][KPISet.ERRORS]))
def test_read_asserts(self): log_path = RESOURCES_DIR + "gatling/" obj = DataLogReader(log_path, logging.getLogger(''), 'gatling-1') list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 3) self.assertEqual(obj.guessed_gatling_version, "2.2+") self.assertIn('ping request', list_of_values[-1][DataPoint.CUMULATIVE].keys())
def test_read_labels_problematic(self): log_path = RESOURCES_DIR + "gatling/" obj = DataLogReader(log_path, ROOT_LOGGER, 'gatling-2') # problematic one list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 1) self.assertEqual(obj.guessed_gatling_version, "2.2+") last_cumul = list_of_values[-1][DataPoint.CUMULATIVE] self.assertEqual(1, last_cumul['User-Login'][KPISet.SAMPLE_COUNT])
def test_read(self): log_path = RESOURCES_DIR + "gatling/" obj = DataLogReader(log_path, ROOT_LOGGER, 'gatling-351') list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 23) self.assertEqual(obj.guessed_gatling_version, "3.4+") self.assertIn('request_1', list_of_values[-1][DataPoint.CUMULATIVE].keys())
def test_read_rc_asserts(self): log_path = RESOURCES_DIR + "gatling/" obj = DataLogReader(log_path, ROOT_LOGGER, 'gatling-5') # regular one list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 1) self.assertEqual(obj.guessed_gatling_version, "2.2+") last_cumul = list_of_values[-1][DataPoint.CUMULATIVE] self.assertEqual(1, last_cumul[''][KPISet.RESP_CODES]['400']) self.assertEqual(1, last_cumul[''][KPISet.RESP_CODES]['401'])
def test_read_labels_problematic(self): log_path = RESOURCES_DIR + "gatling/" obj = DataLogReader(log_path, ROOT_LOGGER, 'gatling-2') # problematic one list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 5) self.assertEqual(obj.guessed_gatling_version, "2.2+") self.assertIn('User-Login,Auth-POST', list_of_values[-1][DataPoint.CUMULATIVE].keys())
def test_read(self): log_path = os.path.join(os.path.dirname(__file__), '..', 'gatling') obj = DataLogReader(log_path, logging.getLogger(''), 'gatling-0') list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 23)
def test_read_220_format(self): log_path = os.path.join(os.path.dirname(__file__), '..', 'gatling') obj = DataLogReader(log_path, logging.getLogger(''), 'gatling-220') list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 4) self.assertEqual(obj.guessed_gatling_version, "2.2")
def test_read(self): log_path = os.path.join(os.path.dirname(__file__), '..', 'gatling') obj = DataLogReader(log_path, logging.getLogger('')) list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 23)
def test_read_220_format(self): log_path = RESOURCES_DIR + "gatling/" obj = DataLogReader(log_path, logging.getLogger(''), 'gatling-220') list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 4) self.assertEqual(obj.guessed_gatling_version, "2.2+")
def test_read_220_format(self): log_path = __dir__() + "/../resources/gatling/" obj = DataLogReader(log_path, logging.getLogger(''), 'gatling-220') list_of_values = list(obj.datapoints(True)) self.assertEqual(len(list_of_values), 4) self.assertEqual(obj.guessed_gatling_version, "2.2")