crossbario / autobahn-python

WebSocket and WAMP in Python for Twisted and asyncio
https://crossbar.io/autobahn
MIT License
2.47k stars 763 forks source link

v22.5.1 removes `autobahn.twisted.testing` #1577

Closed meejah closed 2 years ago

meejah commented 2 years ago

Some of the test-support code was (presumably accidentally?) removed from v22.5.1 (it was in the previous version). PR coming...

oberstet commented 2 years ago

Yeah, I might have removed it while re-enabling a bunch of tests that were deactivated .. had some troubles with trial vs pytest -- I think. anyways, yeah, let's see

oberstet commented 2 years ago

not sure ... but I "rediscovered" the following which might be related to autobahn/twisted/testing

[ERROR]
Traceback (most recent call last):
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/autobahn/twisted/test/test_tx_websocket_agent.py", line 60, in test_secure_echo_server
    proto = yield agent.open("wss://localhost:1234/ws", dict())
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/autobahn/twisted/testing/__init__.py", line 176, in open
    pump = iosim.connect(
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/twisted/test/iosim.py", line 395, in connect
    serverProtocol.makeConnection(serverTransport)
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/twisted/internet/protocol.py", line 514, in makeConnection
    self.connectionMade()
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/autobahn/twisted/websocket.py", line 274, in connectionMade
    self._transport_details = create_transport_details(self.transport, self.is_server)
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/autobahn/twisted/util.py", line 283, in create_transport_details
    'tls-unique': transport_channel_id(transport, is_server, 'tls-unique'),
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/autobahn/twisted/util.py", line 160, in transport_channel_id
    raise RuntimeError(
builtins.RuntimeError: cannot determine TLS channel ID of type "tls-unique" when TLS is not available on this transport <class 'twisted.test.iosim.FakeTransport'>

autobahn.twisted.test.test_tx_websocket_agent.TestAgent.test_secure_echo_server
-------------------------------------------------------------------------------
Ran 373 tests in 15.282s

FAILED (skips=25, errors=1, successes=347)
ERROR: InvocationError for command /home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/bin/trial --no-recurse autobahn.test autobahn.twisted.test autobahn.websocket.test autobahn.rawsocket.test autobahn.wamp.test autobahn.xbr.test autobahn.nvx.test (exited with code 1)
________________________________________________________________ summary ________________________________________________________________
ERROR:   py39-tw203: commands failed
(cpy39_1) (base) oberstet@intel-nuci7:~/scm/crossbario/autobahn-python$ 

Bildschirmfoto von 2022-06-09 03-03-32

oberstet commented 2 years ago

above is for a local run of tests ... the CI does work (it seems to still run less than when run locally)

https://github.com/crossbario/autobahn-python/actions/runs/2465290878

this comes from PR https://github.com/crossbario/autobahn-python/pull/1576

meejah commented 2 years ago

I think the method of skipping is wrong .. I did repeat TLS failures which are a bit .. thorny .. so will look into that (or maybe skip just the TLS test for now so at least the other runs).

oberstet commented 2 years ago

the extra strange thing is: why does it only fail on tx 20.3? but yeah, "wrong method of skipping", no clue in detail though .. tbh, I don't even fully get what https://github.com/crossbario/autobahn-python/blob/master/autobahn/twisted/testing/__init__.py does;)

meejah commented 2 years ago

It lets you write all-in-memory tests for WebSocket protocols (i.e. without using "real" networking at all) .. here's an example: https://github.com/tahoe-lafs/tahoe-lafs/blob/531fe30b11ad981c3bd8ff24a40ac95f3ff5cd19/src/allmydata/test/web/test_logs.py#L88

oberstet commented 2 years ago

ahh .. thanks for explaining, seems useful. fwiw, the code raising is here Bildschirmfoto von 2022-06-11 23-56-45

===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/autobahn/twisted/test/test_tx_websocket_agent.py", line 60, in test_secure_echo_server
    proto = yield agent.open("wss://localhost:1234/ws", dict())
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/autobahn/twisted/testing/__init__.py", line 176, in open
    pump = iosim.connect(
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/twisted/test/iosim.py", line 395, in connect
    serverProtocol.makeConnection(serverTransport)
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/twisted/internet/protocol.py", line 514, in makeConnection
    self.connectionMade()
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/autobahn/twisted/websocket.py", line 274, in connectionMade
    self._transport_details = create_transport_details(self.transport, self.is_server)
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/autobahn/twisted/util.py", line 283, in create_transport_details
    'tls-unique': transport_channel_id(transport, is_server, 'tls-unique'),
  File "/home/oberstet/scm/crossbario/autobahn-python/.tox/py39-tw203/lib/python3.9/site-packages/autobahn/twisted/util.py", line 160, in transport_channel_id
    raise RuntimeError(
builtins.RuntimeError: cannot determine TLS channel ID of type "tls-unique" when TLS is not available on this transport <class 'twisted.test.iosim.FakeTransport'>

autobahn.twisted.test.test_tx_websocket_agent.TestAgent.test_secure_echo_server
-------------------------------------------------------------------------------
Ran 376 tests in 17.324s

FAILED (skips=26, errors=1, successes=349)