From a096956350de9dbecfb19dabb2eda071491c0aee Mon Sep 17 00:00:00 2001 From: Liam Young Date: Wed, 11 Apr 2018 14:52:17 +0000 Subject: [PATCH] Preserve osci's keep the last model behaviour --- zaza/charm_lifecycle/func_test_runner.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zaza/charm_lifecycle/func_test_runner.py b/zaza/charm_lifecycle/func_test_runner.py index 48f5ac5..2a211c5 100644 --- a/zaza/charm_lifecycle/func_test_runner.py +++ b/zaza/charm_lifecycle/func_test_runner.py @@ -25,6 +25,7 @@ def func_test_runner(keep_model=False): :type keep_model: boolean """ test_config = utils.get_charm_config() + last_test = test_config['gate_bundles'][-1] for t in test_config['gate_bundles']: model_name = generate_model_name(test_config['charm_name'], t) # Prepare @@ -37,8 +38,13 @@ def func_test_runner(keep_model=False): configure.configure(model_name, test_config['configure']) # Test test.test(model_name, test_config['tests']) - if not keep_model: - # Destroy + # Destroy + # Keep the model from the last run if keep_model is true, this is to + # maintian compat with osci and should change when the zaza collect + # functions take over from osci for artifact collection. + if keep_model and t == last_test: + pass + else: destroy.destroy(model_name)