Update Xtesting to 0.34.0 83/60683/3
authorCédric Ollivier <cedric.ollivier@orange.com>
Tue, 7 Aug 2018 03:52:55 +0000 (05:52 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Tue, 7 Aug 2018 09:43:29 +0000 (11:43 +0200)
It mainly fixes negative regex operations and allows calling one
skipped test via run_tests (parallel testing).

Change-Id: Ibf34ecf2dae46c4c3af15d05af2946c9eb33f6cd
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
functest/cli/commands/cli_tier.py
functest/tests/unit/odl/test_odl.py
upper-constraints.txt

index a035f85..b8c8a25 100644 (file)
@@ -14,15 +14,12 @@ import click
 from xtesting.ci import tier_builder
 
 from functest.utils import functest_utils
-from functest.utils import env
 
 
 class Tier(object):
 
     def __init__(self):
         self.tiers = tier_builder.TierBuilder(
-            env.get('INSTALLER_TYPE'),
-            env.get('DEPLOY_SCENARIO'),
             pkg_resources.resource_filename('functest', 'ci/testcases.yaml'))
 
     def list(self):
index 0e11f79..c113563 100644 (file)
@@ -244,13 +244,37 @@ class ODLMainTesting(ODLTesting):
                                   side_effect=RobotError):
             self._test_run_suites(testcase.TestCase.EX_RUN_ERROR, *args)
 
+    @mock.patch('os.makedirs')
+    @mock.patch('robot.run')
+    @mock.patch('os.path.isfile', return_value=True)
+    def test_generate_report_ko(self, *args):
+        with mock.patch.object(self.test, 'set_robotframework_vars',
+                               return_value=True), \
+                mock.patch.object(self.test, 'parse_results'), \
+                mock.patch.object(self.test, 'generate_report',
+                                  return_value=1):
+            self._test_run_suites(testcase.TestCase.EX_RUN_ERROR, *args)
+
+    @mock.patch('os.makedirs')
+    @mock.patch('robot.run')
+    @mock.patch('os.path.isfile', return_value=True)
+    def test_generate_report_exc(self, *args):
+        with mock.patch.object(self.test, 'set_robotframework_vars',
+                               return_value=True), \
+                mock.patch.object(self.test, 'parse_results'), \
+                mock.patch.object(self.test, 'generate_report',
+                                  side_effect=Exception):
+            self._test_run_suites(testcase.TestCase.EX_RUN_ERROR, *args)
+
     @mock.patch('os.makedirs')
     @mock.patch('robot.run')
     @mock.patch('os.path.isfile', return_value=True)
     def test_ok(self, *args):
         with mock.patch.object(self.test, 'set_robotframework_vars',
                                return_value=True), \
-                mock.patch.object(self.test, 'parse_results'):
+                mock.patch.object(self.test, 'parse_results'), \
+                mock.patch.object(self.test, 'generate_report',
+                                  return_value=0):
             self._test_run_suites(testcase.TestCase.EX_OK, *args)
 
     @mock.patch('os.makedirs')
@@ -259,7 +283,9 @@ class ODLMainTesting(ODLTesting):
     def test_ok_no_creds(self, *args):
         with mock.patch.object(self.test, 'set_robotframework_vars',
                                return_value=True) as mock_method, \
-                mock.patch.object(self.test, 'parse_results'):
+                mock.patch.object(self.test, 'parse_results'), \
+                mock.patch.object(self.test, 'generate_report',
+                                  return_value=0):
             self._test_run_suites(testcase.TestCase.EX_OK, *args)
             mock_method.assert_not_called()
 
@@ -269,7 +295,9 @@ class ODLMainTesting(ODLTesting):
     def test_testcases_in_failure(self, *args):
         with mock.patch.object(self.test, 'set_robotframework_vars',
                                return_value=True), \
-                mock.patch.object(self.test, 'parse_results'):
+                mock.patch.object(self.test, 'parse_results'), \
+                mock.patch.object(self.test, 'generate_report',
+                                  return_value=0):
             self._test_run_suites(testcase.TestCase.EX_OK, *args)
 
 
index e56c1b7..f41c831 100644 (file)
@@ -19,6 +19,6 @@ robotframework-sshlibrary===2.1.3;python_version=='2.7'
 IPy===0.83
 ansible===2.3.2.0
 flasgger===0.6.6
-xtesting===0.33.0
+xtesting===0.34.0
 networking-bgpvpn===7.0.0
 sphinx-opnfv-theme===0.1.1