diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2017-09-18 14:16:07 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2017-09-19 10:30:08 +0200 |
commit | 718fa71383d6f10caa715907be5e56ec8e1bc89b (patch) | |
tree | 78910a4b0191bc0a33f755a24a40ba8ed6d66acd /functest/ci | |
parent | eee462a22edaebd2ddbc6d2ac05ed643bf9070b8 (diff) |
Return Functest status to Jenkins
It avoids mixing Functest and Features CI issues by simply exiting the
status of Functest testcases. The result of third-party testcases are
printed into console but are no longer taken into account into the
global status.
Change-Id: I040ff54780db2ddb6d81993839fee09f5e472323
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 516d1bd7811f5751d796748ddd52f798bbd5a40f)
Diffstat (limited to 'functest/ci')
-rw-r--r-- | functest/ci/run_tests.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index a129ea737..d4acd9c56 100644 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -124,16 +124,18 @@ class Runner(object): self.executed_test_cases[test.get_name()] = test_case if self.clean_flag: if test_case.create_snapshot() != test_case.EX_OK: - return result + return testcase.TestCase.EX_RUN_ERROR try: kwargs = run_dict['args'] - result = test_case.run(**kwargs) + test_case.run(**kwargs) except KeyError: - result = test_case.run() - if result == testcase.TestCase.EX_OK: - if self.report_flag: - test_case.push_to_db() + test_case.run() + if self.report_flag: + test_case.push_to_db() + if test.get_project() == "functest": result = test_case.is_successful() + else: + result = testcase.TestCase.EX_OK logger.info("Test result:\n\n%s\n", test_case) if self.clean_flag: test_case.clean() @@ -157,10 +159,12 @@ class Runner(object): else: logger.info("Running tier '%s'" % tier_name) for test in tests: - result = self.run_test(test) - if result != testcase.TestCase.EX_OK: + self.run_test(test) + test_case = self.executed_test_cases[test.get_name()] + if test_case.is_successful() != testcase.TestCase.EX_OK: logger.error("The test case '%s' failed.", test.get_name()) - self.overall_result = Result.EX_ERROR + if test.get_project() == "functest": + self.overall_result = Result.EX_ERROR if test.is_blocking(): raise BlockingTestFailed( "The test case {} failed and is blocking".format( |