diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-04 11:47:40 +0200 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-04 14:35:07 +0200 |
commit | 6790e17eb7c1a3eaaccfe97ac90932e3c15eea6d (patch) | |
tree | 06697206e1323dd3acdce742a2e1e5d5bb4b232f /ci/run_tests.py | |
parent | 7ad2ce42a2bc2c8dc17fbc9423da71a95fed4d87 (diff) |
Refactor improvements
JIRA: FUNCTEST-190
- Deleted unnecessary old scripts
- Fixed healtcheck logging
- Moved config_functest.yaml to /ci/
- Created env var CONFIG_FUNCTEST_YAML pointing to that new location
- Modified all scripts which open config_functest.yaml using the new env var
Change-Id: Ic4f0e40a70c02ac08287a1d621956f602bdee177
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'ci/run_tests.py')
-rw-r--r-- | ci/run_tests.py | 25 |
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) |