From f3c9a45149e8ffac53ef12c84f51013e7e699548 Mon Sep 17 00:00:00 2001 From: rameshthoomu Date: Mon, 29 Aug 2016 20:30:25 -0400 Subject: [PATCH] Verify compose_containers in context attribute Builds are failing with attribute error in jenkins CI as compose_containers are not loading properly. Adding this logic to skip the test and continue with other tests and print the logs. Change-Id: I08d141c187ab176d034dd6032e36d7e53e938be8 Signed-off-by: rameshthoomu --- bddtests/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bddtests/environment.py b/bddtests/environment.py index 246bb87e17e..58f747d367b 100644 --- a/bddtests/environment.py +++ b/bddtests/environment.py @@ -19,7 +19,7 @@ def getDockerComposeFileArgsFromYamlFile(compose_yaml): def after_scenario(context, scenario): get_logs = context.config.userdata.get("logs", "N") - if get_logs.lower() == "force" or (scenario.status == "failed" and get_logs.lower() == "y"): + if get_logs.lower() == "force" or (scenario.status == "failed" and get_logs.lower() == "y" and "compose_containers" in context): print("Scenario {0} failed. Getting container logs".format(scenario.name)) file_suffix = "_" + scenario.name.replace(" ", "_") + ".log" # get logs from the peer containers