def test_report_transactions_as_failed(self): self.configure({ "execution": [{ "test-mode": "apiritif", "iterations": 1, "scenario": { "default-address": "http://httpbin.org", "requests": [{ "label": "failure by 404", "url": "/status/404", }] } }] }) self.obj.engine.aggregator = FunctionalAggregator() self.obj.prepare() try: self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) finally: self.obj.shutdown() self.obj.post_process() self.assertNotEquals(self.obj.process, None) reader = LoadSamplesReader( os.path.join(self.obj.engine.artifacts_dir, "apiritif.0.ldjson"), self.obj.log) samples = list(reader._read(last_pass=True)) self.assertEqual(len(samples), 1) tstmp, label, concur, rtm, cnn, ltc, rcd, error, trname, byte_count = samples[ 0] self.assertIsNotNone(error)
def test_report_transactions_as_failed(self): self.configure({ "execution": [{ "test-mode": "apiritif", "iterations": 1, "scenario": { "default-address": "http://httpbin.org", "requests": [{ "label": "failure by 404", "url": "/status/404", }] } }] }) self.obj.engine.aggregator = FunctionalAggregator() self.obj.prepare() try: self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) finally: self.obj.shutdown() self.obj.post_process() self.assertNotEquals(self.obj.process, None) reader = LoadSamplesReader(os.path.join(self.obj.engine.artifacts_dir, "apiritif.0.ldjson"), self.obj.log) samples = list(reader._read(last_pass=True)) self.assertEqual(len(samples), 1) tstmp, label, concur, rtm, cnn, ltc, rcd, error, trname, byte_count = samples[0] self.assertIsNotNone(error)
def test_report_transactions_as_failed(self): self.configure({ "execution": [{ "test-mode": "apiritif", "scenario": { "default-address": "http://httpbin.org", "requests": [{ "label": "failure by 404", "url": "/status/404", }] } }] }) self.obj.prepare() try: self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) finally: self.obj.shutdown() self.obj.post_process() self.assertNotEquals(self.obj.process, None) with open(self.obj.report_file) as fds: self.obj.log.debug("Report: %s", fds.read()) reader = LoadSamplesReader(self.obj.report_file, self.obj.log) samples = list(reader._read(last_pass=True)) self.assertEqual(len(samples), 1) tstmp, label, concur, rtm, cnn, ltc, rcd, error, trname, byte_count = samples[ 0] self.assertIsNotNone(error)
def test_report_reader(self): reader = LoadSamplesReader(RESOURCES_DIR + "selenium/report.ldjson", ROOT_LOGGER) items = list(reader._read(last_pass=True)) self.assertEqual(4, len(items)) self.assertEqual(items[0][1], 'testFailure') self.assertEqual(items[0][6], '400') self.assertEqual(items[1][1], 'testBroken') self.assertEqual(items[1][6], '500') self.assertEqual(items[2][1], 'testSuccess') self.assertEqual(items[2][6], '200') self.assertEqual(items[3][1], 'testUnexp') self.assertEqual(items[3][6], 'UNKNOWN')
def test_report_reader(self): reader = LoadSamplesReader(RESOURCES_DIR + "selenium/report.ldjson", ROOT_LOGGER) items = list(reader._read(last_pass=True)) self.assertEqual(4, len(items)) self.assertEqual(items[0][1], 'testFailure') self.assertEqual(items[0][6], '400') self.assertEqual(items[1][1], 'testBroken') self.assertEqual(items[1][6], '500') self.assertEqual(items[2][1], 'testSuccess') self.assertEqual(items[2][6], '200') self.assertEqual(items[3][1], 'testUnexp') self.assertEqual(items[3][6], 'UNKNOWN')
def test_report_reader(self): reader = LoadSamplesReader(__dir__() + "/../../resources/selenium/report.ldjson", logging.getLogger(), None) items = list(reader._read()) self.assertEqual(4, len(items)) self.assertEqual(items[0][1], 'testFailure') self.assertEqual(items[0][6], '400') self.assertEqual(items[1][1], 'testBroken') self.assertEqual(items[1][6], '500') self.assertEqual(items[2][1], 'testSuccess') self.assertEqual(items[2][6], '200') self.assertEqual(items[3][1], 'testUnexp') self.assertEqual(items[3][6], 'UNKNOWN')