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-18 16:31:39 +0200 |
commit | 516d1bd7811f5751d796748ddd52f798bbd5a40f (patch) | |
tree | 2b231bd502a825e9d92a8f19bc1acd24e2f90354 /functest/tests/unit/ci/test_run_tests.py | |
parent | 3e22a3e6d5b4df227f2ca96d214a7c78edd56163 (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>
Diffstat (limited to 'functest/tests/unit/ci/test_run_tests.py')
-rw-r--r-- | functest/tests/unit/ci/test_run_tests.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/functest/tests/unit/ci/test_run_tests.py b/functest/tests/unit/ci/test_run_tests.py index 7495c40e..bc95f8f3 100644 --- a/functest/tests/unit/ci/test_run_tests.py +++ b/functest/tests/unit/ci/test_run_tests.py @@ -31,6 +31,10 @@ class RunTestsTesting(unittest.TestCase): def setUp(self): self.runner = run_tests.Runner() + mock_test_case = mock.Mock() + mock_test_case.is_successful.return_value = TestCase.EX_OK + self.runner.executed_test_cases['test1'] = mock_test_case + self.runner.executed_test_cases['test2'] = mock_test_case self.sep = 'test_sep' self.creds = {'OS_AUTH_URL': 'http://test_ip:test_port/v2.0', 'OS_USERNAME': 'test_os_username', @@ -191,8 +195,10 @@ class RunTestsTesting(unittest.TestCase): @mock.patch('functest.ci.run_tests.Runner.summary') def test_main_tier(self, *mock_methods): mock_tier = mock.Mock() + test_mock = mock.Mock() + test_mock.get_name.return_value = 'test1' args = {'get_name.return_value': 'tier_name', - 'get_tests.return_value': ['test_name']} + 'get_tests.return_value': [test_mock]} mock_tier.configure_mock(**args) kwargs = {'test': 'tier_name', 'noclean': True, 'report': True} args = {'get_tier.return_value': mock_tier, @@ -201,7 +207,7 @@ class RunTestsTesting(unittest.TestCase): self.runner._tiers.configure_mock(**args) self.assertEqual(self.runner.main(**kwargs), run_tests.Result.EX_OK) - mock_methods[1].assert_called_once_with('test_name') + mock_methods[1].assert_called() @mock.patch('functest.ci.run_tests.Runner.source_rc_file') @mock.patch('functest.ci.run_tests.Runner.run_test', |