diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-02 19:05:54 +0200 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-02 19:37:04 +0200 |
commit | fa36ceb257c34874fa9169ee5757ec16c8207df6 (patch) | |
tree | 4d699b11b4c7eecc7772e04eb3e7f7e2c8dc62ad /ci/run_tests.py | |
parent | 96a2b487563a5aeebe1a4d4bb31018408771d360 (diff) |
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 <jose.lausuch@ericsson.com>
Diffstat (limited to 'ci/run_tests.py')
-rw-r--r-- | ci/run_tests.py | 23 |
1 files changed, 20 insertions, 3 deletions
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) |