From fa36ceb257c34874fa9169ee5757ec16c8207df6 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Mon, 2 May 2016 19:05:54 +0200 Subject: Add command to execute the actual tests JIRA: FUNCTEST-190 Run_tests was generating the tests cases to be executed, but not actually running them. This patch also includes a small enhancement to avoid too much output when showing which tiers to be tested. Change-Id: Id70cfe44a8263ce7f598386668a33c67a8961b42 Signed-off-by: jose.lausuch --- ci/run_tests.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'ci/run_tests.py') diff --git a/ci/run_tests.py b/ci/run_tests.py index 3b3ed2c4..10621440 100644 --- a/ci/run_tests.py +++ b/ci/run_tests.py @@ -10,6 +10,7 @@ import argparse import os +import subprocess import sys import functest.ci.tier_builder as tb @@ -80,14 +81,26 @@ def run_test(test): flags += " -r" cmd = ("%s%s" % (EXEC_SCRIPT, flags)) - logger.debug("Executing command %s" % cmd) - + logger.debug("Executing command '%s'" % cmd) print_separator("") + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) + + while p.poll() is None: + line = p.stdout.readline().rstrip() + logger.debug(line) + + if p != 0: + logger.error("The command '%s' failed. Cleaning and exiting." % cmd) + if CLEAN_FLAG: + cleanup() + sys.exit(1) + if CLEAN_FLAG: cleanup() + def run_tier(tier): print_separator("#") logger.info("Running tier '%s'" % tier.get_name()) @@ -98,7 +111,11 @@ def run_tier(tier): def run_all(tiers): - logger.debug("Tiers to be executed:\n\n%s" % tiers) + logger.debug("Tiers to be executed:") + for tier in tiers.get_tiers(): + logger.info("\n - %s. %s:\n\t%s" + % (tier.get_order(), tier.get_name(), tier.get_tests())) + for tier in tiers.get_tiers(): run_tier(tier) -- cgit 1.2.3-korg