From 184870ac5a266c37987e4a4d97ab4d4efefacb1f Mon Sep 17 00:00:00 2001 From: "juraj.linkes" Date: Mon, 16 Jul 2018 14:22:01 +0200 Subject: CSIT-1139: Implement parallel test execution The implementation of parallel test execution in VPP Test Framework. - VPPTestCase test methods are grouped together - tests are running in separate processes - VPP instances spawned by tests are assigned to different cores - output from these processes is redirected through pipes and printed out testcase by testcase - TEST_JOBS env var is used to specify the number of parallel processes - improved test summary - a bit of code cleanup Change-Id: I9ca93904d9fe2c3daf980500c64a8611838ae28c Signed-off-by: juraj.linkes --- test/log.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'test/log.py') diff --git a/test/log.py b/test/log.py index 1e541d38352..aff182e086e 100644 --- a/test/log.py +++ b/test/log.py @@ -38,8 +38,9 @@ else: log_level = 40 handler = logging.StreamHandler(sys.stdout) -handler.setFormatter(ColorFormatter(fmt='%(asctime)s,%(msecs)03d %(message)s', - datefmt="%H:%M:%S")) +color_formatter = ColorFormatter(fmt='%(asctime)s,%(msecs)03d %(message)s', + datefmt="%H:%M:%S") +handler.setFormatter(color_formatter) handler.setLevel(log_level) global_logger = logging.getLogger() @@ -54,6 +55,16 @@ def getLogger(name): logger.setLevel(logging.DEBUG) return logger + +def get_parallel_logger(stream): + logger = logging.getLogger('parallel_logger_{}'.format(stream)) + logger.propagate = False + handler = logging.StreamHandler(stream) + handler.setFormatter(color_formatter) + handler.setLevel(log_level) + logger.addHandler(handler) + return logger + # Static variables to store color formatting strings. # # These variables (RED, GREEN, YELLOW and LPURPLE) are used to configure -- cgit 1.2.3-korg