summaryrefslogtreecommitdiffstats
path: root/ci/run_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'ci/run_tests.py')
-rw-r--r--ci/run_tests.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/ci/run_tests.py b/ci/run_tests.py
index 106214400..5b9309828 100644
--- a/ci/run_tests.py
+++ b/ci/run_tests.py
@@ -33,7 +33,7 @@ args = parser.parse_args()
""" logging configuration """
-logger = ft_logger.Logger("run_test").getLogger()
+logger = ft_logger.Logger("run_tests").getLogger()
""" global variables """
@@ -48,7 +48,6 @@ def print_separator(str, count=45):
line = ""
for i in range(0, count - 1):
line += str
-
logger.info("%s" % line)
@@ -62,16 +61,11 @@ def source_rc_file():
def cleanup():
- print_separator("+")
- logger.info("Cleaning OpenStack resources...")
- print_separator("+")
clean_os.main()
- print_separator("")
def run_test(test):
test_name = test.get_name()
- print_separator("")
print_separator("=")
logger.info("Running test case '%s'..." % test_name)
print_separator("=")
@@ -82,7 +76,6 @@ def run_test(test):
cmd = ("%s%s" % (EXEC_SCRIPT, flags))
logger.debug("Executing command '%s'" % cmd)
- print_separator("")
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
@@ -90,8 +83,9 @@ def run_test(test):
line = p.stdout.readline().rstrip()
logger.debug(line)
- if p != 0:
- logger.error("The command '%s' failed. Cleaning and exiting." % cmd)
+ if p.returncode != 0:
+ logger.error("The test case '%s' failed. Cleaning and exiting."
+ % test_name)
if CLEAN_FLAG:
cleanup()
sys.exit(1)
@@ -100,7 +94,6 @@ def run_test(test):
cleanup()
-
def run_tier(tier):
print_separator("#")
logger.info("Running tier '%s'" % tier.get_name())
@@ -111,10 +104,14 @@ def run_tier(tier):
def run_all(tiers):
- logger.debug("Tiers to be executed:")
+ summary = ""
for tier in tiers.get_tiers():
- logger.info("\n - %s. %s:\n\t%s"
- % (tier.get_order(), tier.get_name(), tier.get_tests()))
+ summary += ("\n - %s. %s:\n\t %s"
+ % (tier.get_order(),
+ tier.get_name(),
+ tier.get_test_names()))
+
+ logger.info("Tiers to be executed:%s" % summary)
for tier in tiers.get_tiers():
run_tier(tier)