Skip to content

Commit

Permalink
tests/test_crossbar: mark tests incompatible with python3.12+
Browse files Browse the repository at this point in the history
crossbar is not compatible with Python 3.12, yet: [1] and [2] are not
part of a release. A release will probably take some more time [3][4].

Since this is the last remaining issue before we can advertise Python
3.12 support, let's mark these tests as XFAIL for now.

[1] crossbario/crossbar#2091
[2] crossbario/crossbar#2093
[3] crossbario/crossbar#2093 (comment)
[4] crossbario/crossbar#2091 (comment)

Signed-off-by: Bastian Krause <[email protected]>
  • Loading branch information
basti2342 committed Dec 13, 2023
1 parent c4a0867 commit 3908c4e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_crossbar.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import sys
import time

import pytest
Expand All @@ -21,6 +22,7 @@ def resume_tree(pid):
for child in main.children(recursive=True):
child.resume()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_startup(crossbar):
pass

Expand Down Expand Up @@ -69,6 +71,7 @@ def test_connect_error():
spawn.close()
assert spawn.exitstatus == 1, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_connect_timeout(crossbar):
suspend_tree(crossbar.pid)
try:
Expand All @@ -81,13 +84,15 @@ def test_connect_timeout(crossbar):
resume_tree(crossbar.pid)
pass

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_show(place):
with pexpect.spawn('python -m labgrid.remote.client -p test show') as spawn:
spawn.expect("Place 'test':")
spawn.expect(pexpect.EOF)
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_alias(place):
with pexpect.spawn('python -m labgrid.remote.client -p test add-alias foo') as spawn:
spawn.expect(pexpect.EOF)
Expand All @@ -99,6 +104,7 @@ def test_place_alias(place):
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_comment(place):
with pexpect.spawn('python -m labgrid.remote.client -p test set-comment my comment') as spawn:
spawn.expect(pexpect.EOF)
Expand All @@ -112,6 +118,7 @@ def test_place_comment(place):
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_match(place):
with pexpect.spawn('python -m labgrid.remote.client -p test add-match "e1/g1/r1" "e2/g2/*"') as spawn:
spawn.expect(pexpect.EOF)
Expand All @@ -130,6 +137,7 @@ def test_place_match(place):
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_match_duplicates(place):
# first given match should succeed, second should be skipped
matches = (
Expand All @@ -150,6 +158,7 @@ def test_place_match_duplicates(place):
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_acquire(place):
with pexpect.spawn('python -m labgrid.remote.client -p test acquire') as spawn:
spawn.expect(pexpect.EOF)
Expand All @@ -167,6 +176,7 @@ def test_place_acquire(place):
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_acquire_enforce(place):
with pexpect.spawn('python -m labgrid.remote.client -p test add-match does/not/exist') as spawn:
spawn.expect(pexpect.EOF)
Expand All @@ -190,6 +200,7 @@ def test_place_acquire_enforce(place):
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_acquire_broken(place, exporter):
with pexpect.spawn('python -m labgrid.remote.client -p test add-match "*/Broken/*"') as spawn:
spawn.expect(pexpect.EOF)
Expand All @@ -209,6 +220,7 @@ def test_place_acquire_broken(place, exporter):
print(spawn.before.decode())
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_release_from(monkeypatch, place, exporter):
user = "test-user"
host = "test-host"
Expand Down Expand Up @@ -255,20 +267,23 @@ def test_place_release_from(monkeypatch, place, exporter):
before = spawn.before.decode("utf-8").strip()
assert user not in before and not host in before, before

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_add_no_name(crossbar):
with pexpect.spawn('python -m labgrid.remote.client create') as spawn:
spawn.expect("missing place name")
spawn.expect(pexpect.EOF)
spawn.close()
assert spawn.exitstatus != 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_place_del_no_name(crossbar):
with pexpect.spawn('python -m labgrid.remote.client delete') as spawn:
spawn.expect("deletes require an exact place name")
spawn.expect(pexpect.EOF)
spawn.close()
assert spawn.exitstatus != 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_remoteplace_target(place_acquire, tmpdir):
from labgrid.environment import Environment
p = tmpdir.join("config.yaml")
Expand All @@ -289,6 +304,7 @@ def test_remoteplace_target(place_acquire, tmpdir):
remote_place = t.get_resource("RemotePlace")
assert remote_place.tags == {"board": "bar"}

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_remoteplace_target_without_env(request, place_acquire):
from labgrid import Target
from labgrid.resource import RemotePlace
Expand All @@ -297,6 +313,7 @@ def test_remoteplace_target_without_env(request, place_acquire):
remote_place = RemotePlace(t, name="test")
assert remote_place.tags == {"board": "bar"}

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_resource_conflict(place_acquire, tmpdir):
with pexpect.spawn('python -m labgrid.remote.client -p test2 create') as spawn:
spawn.expect(pexpect.EOF)
Expand All @@ -318,6 +335,7 @@ def test_resource_conflict(place_acquire, tmpdir):
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_reservation(place_acquire, tmpdir):
with pexpect.spawn('python -m labgrid.remote.client reserve --shell board=bar name=test') as spawn:
spawn.expect(pexpect.EOF)
Expand Down Expand Up @@ -395,6 +413,7 @@ def test_reservation(place_acquire, tmpdir):
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_exporter_timeout(place, exporter):
with pexpect.spawn('python -m labgrid.remote.client resources') as spawn:
spawn.expect(pexpect.EOF)
Expand Down Expand Up @@ -432,6 +451,7 @@ def test_exporter_timeout(place, exporter):
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_reservation_custom_config(place, exporter, tmpdir):
p = tmpdir.join("config.yaml")
p.write(
Expand Down Expand Up @@ -469,6 +489,7 @@ def test_reservation_custom_config(place, exporter, tmpdir):
spawn.close()
assert spawn.exitstatus == 0, spawn.before.strip()

@pytest.mark.xfail(sys.version_info >= (3, 12), reason="latest crossbar release incompatible with python3.12+")
def test_same_name_resources(place, exporter, tmpdir):
with pexpect.spawn('python -m labgrid.remote.client -p test add-named-match "testhost/Many/NetworkService" "samename"') as spawn:
spawn.expect(pexpect.EOF)
Expand Down

0 comments on commit 3908c4e

Please sign in to comment.