Skip to content

Commit

Permalink
tests: yajsonrpc: Use TRAVIS_CI on broken tests
Browse files Browse the repository at this point in the history
We don't use jenkins CI anymore.

Signed-off-by: Marcin Sobczyk <[email protected]>
  • Loading branch information
tinez authored and nirs committed Jan 11, 2022
1 parent 7af5c27 commit 616280d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
16 changes: 8 additions & 8 deletions tests/lib/yajsonrpc/jsonrpcserver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _collect_events(self, event_queue):
return res

@permutations(USE_SSL)
@broken_on_ci(reason="Fails randomly in CI")
@broken_on_ci(reason="Fails randomly in CI", name="TRAVIS_CI")
def testMethodCallArgList(self, use_ssl):
data = dummyTextGenerator(1024)
ssl_ctx = self.ssl_ctx if use_ssl else None
Expand All @@ -167,7 +167,7 @@ def testMethodCallArgList(self, use_ssl):
(data,), CALL_ID), data)

@permutations(USE_SSL)
@broken_on_ci("fails randomly in CI")
@broken_on_ci("fails randomly in CI", name="TRAVIS_CI")
def testMethodCallArgDict(self, use_ssl):
data = dummyTextGenerator(1024)
ssl_ctx = self.ssl_ctx if use_ssl else None
Expand All @@ -179,7 +179,7 @@ def testMethodCallArgDict(self, use_ssl):
{'text': data}, CALL_ID), data)

@permutations(USE_SSL)
@broken_on_ci("fails randomly in CI")
@broken_on_ci("fails randomly in CI", name="TRAVIS_CI")
def testMethodMissingMethod(self, use_ssl):
missing_method = "I_DO_NOT_EXIST :("
ssl_ctx = self.ssl_ctx if use_ssl else None
Expand All @@ -197,7 +197,7 @@ def testMethodMissingMethod(self, use_ssl):
self.assertIn(missing_method, cm.exception.msg)

@permutations(USE_SSL)
@broken_on_ci("fails randomly in CI")
@broken_on_ci("fails randomly in CI", name="TRAVIS_CI")
def testMethodBadParameters(self, use_ssl):
# Without a schema the server returns an internal error
ssl_ctx = self.ssl_ctx if use_ssl else None
Expand All @@ -213,7 +213,7 @@ def testMethodBadParameters(self, use_ssl):
JsonRpcInternalError().code)

@permutations(USE_SSL)
@broken_on_ci("fails randomly in CI")
@broken_on_ci("fails randomly in CI", name="TRAVIS_CI")
def testMethodReturnsNullAndServerReturnsTrue(self, use_ssl):
ssl_ctx = self.ssl_ctx if use_ssl else None
bridge = _DummyBridge()
Expand All @@ -240,7 +240,7 @@ def testSlowMethod(self, use_ssl):

@MonkeyPatch(executor.Executor, 'dispatch', dispatch)
@permutations(USE_SSL)
@broken_on_ci("fails randomly in CI")
@broken_on_ci("fails randomly in CI", name="TRAVIS_CI")
def testFullExecutor(self, use_ssl):
ssl_ctx = self.ssl_ctx if use_ssl else None
bridge = _DummyBridge()
Expand All @@ -254,7 +254,7 @@ def testFullExecutor(self, use_ssl):
JsonRpcInternalError().code)

@permutations(USE_SSL)
@broken_on_ci("fails randomly in CI")
@broken_on_ci("fails randomly in CI", name="TRAVIS_CI")
def testClientSubscribe(self, use_ssl):
ssl_ctx = self.ssl_ctx if use_ssl else None
bridge = _DummyBridge()
Expand All @@ -277,7 +277,7 @@ def testClientSubscribe(self, use_ssl):
self.assertEqual(event_params['content'], True)

@permutations(USE_SSL)
@broken_on_ci("fails randomly in CI")
@broken_on_ci("fails randomly in CI", name="TRAVIS_CI")
def testClientNotify(self, use_ssl):
ssl_ctx = self.ssl_ctx if use_ssl else None
bridge = _DummyBridge()
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/yajsonrpc/stomp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def run(self, result=None):
super(TestCaseBase, self).run(result)

@broken_on_ci(
"Fails randomly in oVirt CI, see https://gerrit.ovirt.org/c/95899/")
"Fails randomly in oVirt CI, see https://gerrit.ovirt.org/c/95899/",
name="TRAVIS_CI")
@permutations([
# size, use_ssl
(1024, True),
Expand Down
14 changes: 7 additions & 7 deletions tests/lib/yajsonrpc/stomprpcclient_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ def _get_with_timeout(self, event_queue):
except queue.Empty:
self.fail("Event queue timed out.")

@broken_on_ci("Fails randomly in CI")
@broken_on_ci("Fails randomly in CI", name="TRAVIS_CI")
def test_call(self):
with self._create_client() as client:
msg = dummyTextGenerator(1024)
res = client.Test.echo(text=msg)

self.assertEqual(msg, res)

@broken_on_ci("Fails randomly in CI")
@broken_on_ci("Fails randomly in CI", name="TRAVIS_CI")
def test_failing_call(self):
with self._create_client() as client:
with self.assertRaises(ServerError) as ex:
Expand All @@ -155,7 +155,7 @@ def test_failing_call(self):
)
self.assertIn("Test failure", str(ex.exception))

@broken_on_ci("Fails randomly in CI")
@broken_on_ci("Fails randomly in CI", name="TRAVIS_CI")
def test_missing_method(self):
with self._create_client() as client:
with self.assertRaises(ServerError) as ex:
Expand All @@ -170,7 +170,7 @@ def test_missing_namespace(self):
with self.assertRaises(AttributeError):
client.MissingNamespace.missingMethod()

@broken_on_ci("Fails randomly in CI")
@broken_on_ci("Fails randomly in CI", name="TRAVIS_CI")
def test_bad_parameters(self):
with self._create_client() as client:
with self.assertRaises(ServerError) as ex:
Expand Down Expand Up @@ -211,7 +211,7 @@ def test_slow_call(self):
with self.assertRaises(TimeoutError):
client.Test.slowCall()

@broken_on_ci(reason="Fails randomly in CI")
@broken_on_ci(reason="Fails randomly in CI", name="TRAVIS_CI")
def test_event_handler(self):
with self._create_client() as client:
event_queue = queue.Queue()
Expand All @@ -229,7 +229,7 @@ def test_event_handler(self):
None
)

@broken_on_ci(reason="Fails randomly in CI")
@broken_on_ci(reason="Fails randomly in CI", name="TRAVIS_CI")
def test_multiple_queues(self):
with self._create_client() as client:
event_queue1 = queue.Queue()
Expand Down Expand Up @@ -273,7 +273,7 @@ def test_unsubscribe(self):
None
)

@broken_on_ci(reason="Fails randomly in CI")
@broken_on_ci(reason="Fails randomly in CI", name="TRAVIS_CI")
def test_notify(self):
with self._create_client() as client:
event_queue = queue.Queue()
Expand Down

0 comments on commit 616280d

Please sign in to comment.