aboutsummaryrefslogtreecommitdiffstats
path: root/functest/ci/run_tests.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-02-24 11:41:33 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-02-24 15:28:54 +0100
commit67e9875d82d1ee2de3ed64d756092b1f5698c9c0 (patch)
tree994a1c27c8347a975814eeaf4991d1a59e6e6947 /functest/ci/run_tests.py
parenta1b0f64bccea682e55ec5086aef979df57cf686f (diff)
Print env vars and env_file
It simply eases detecting wrong inputs [1]. [1] https://build.opnfv.org/ci/view/functest/job/functest-apex-baremetal-daily-master/796/console Change-Id: I0784c29265c69a6ba4a049226196bcdd70b0a572 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/ci/run_tests.py')
-rw-r--r--functest/ci/run_tests.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py
index 0b980303..651a3851 100644
--- a/functest/ci/run_tests.py
+++ b/functest/ci/run_tests.py
@@ -101,7 +101,6 @@ class Runner(object):
LOGGER.debug("No env file %s found", rc_file)
return
with open(rc_file, "r") as rcfd:
- LOGGER.info("Sourcing env file %s", rc_file)
for line in rcfd:
var = (line.rstrip('"\n').replace('export ', '').split(
"=") if re.search(r'(.*)=(.*)', line) else None)
@@ -112,6 +111,8 @@ class Runner(object):
key = re.sub(r'^["\' ]*|[ \'"]*$', '', var[0])
value = re.sub(r'^["\' ]*|[ \'"]*$', '', "".join(var[1:]))
os.environ[key] = value
+ rcfd.seek(0, 0)
+ LOGGER.info("Sourcing env file %s\n\n%s", rc_file, rcfd.read())
@staticmethod
def get_dict_by_test(testname):
@@ -228,10 +229,9 @@ class Runner(object):
if 'report' in kwargs:
self.report_flag = kwargs['report']
try:
+ LOGGER.info("Deployment description:\n\n%s\n", env.string())
+ self.source_envfile()
if 'test' in kwargs:
- LOGGER.debug("Sourcing the credential file...")
- self.source_envfile()
-
LOGGER.debug("Test args: %s", kwargs['test'])
if self.tiers.get_tier(kwargs['test']):
self.run_tier(self.tiers.get_tier(kwargs['test']))
@@ -268,13 +268,6 @@ class Runner(object):
"""To generate functest report showing the overall results"""
msg = prettytable.PrettyTable(
header_style='upper', padding_width=5,
- field_names=['env var', 'value'])
- for env_var in ['INSTALLER_TYPE', 'DEPLOY_SCENARIO', 'BUILD_TAG',
- 'CI_LOOP']:
- msg.add_row([env_var, env.get(env_var)])
- LOGGER.info("Deployment description:\n\n%s\n", msg)
- msg = prettytable.PrettyTable(
- header_style='upper', padding_width=5,
field_names=['test case', 'project', 'tier',
'duration', 'result'])
tiers = [tier] if tier else self.tiers.get_tiers()