tests: Add decorator to mark unstable tests

As it was agreed on Neutron CI meeting, we're going to mark unstable
tests in fullstack suite with this decorator while working in paralel on
stabilization of such tests.

One test in fullstack suite was marked with this decorator to prove its
functionality.

Change-Id: I3beb6e7a4d96da778378e9d979cb8c6261f6036b
This commit is contained in:
Jakub Libosvar 2017-10-24 13:11:14 +00:00 committed by Jakub Libosvar
parent b520b16d8a
commit bdda46ade7
2 changed files with 16 additions and 0 deletions

View File

@ -98,6 +98,20 @@ def sanitize_log_path(path):
return path
def unstable_test(reason):
def decor(f):
@functools.wraps(f)
def inner(self, *args, **kwargs):
try:
return f(self, *args, **kwargs)
except Exception as e:
msg = ("%s was marked as unstable because of %s, "
"failure was: %s") % (self.id(), reason, e)
raise self.skipTest(msg)
return inner
return decor
class AttributeDict(dict):
"""

View File

@ -21,6 +21,7 @@ from oslo_utils import uuidutils
import testscenarios
from neutron.common import utils as common_utils
from neutron.tests import base as tests_base
from neutron.tests.common import net_helpers
from neutron.tests.fullstack import base
from neutron.tests.fullstack.resources import config
@ -118,6 +119,7 @@ class TestOvsConnectivitySameNetwork(BaseConnectivitySameNetworkTest):
scenarios = testscenarios.multiply_scenarios(
network_scenarios, utils.get_ovs_interface_scenarios())
@tests_base.unstable_test("bug 1728948")
def test_connectivity(self):
self._test_connectivity()