Skip to content

Commit 0d7ce75

Browse files
committed
test(integration): use unique names to avoid schema state false positives
- Generate unique label and edge type names per test run so that stale schema entries from previous runs cannot cause spurious assertion hits - Change xfail marker to strict=False for inbound traverse test so CI reports XPASS as a warning instead of a hard failure when server eventually adds inbound support
1 parent 4990122 commit 0d7ce75

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

tests/integration/test_sdk.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,17 @@ def test_get_schema_text(client):
214214
def test_get_labels_returns_list(client):
215215
"""get_labels() returns a non-empty list of LabelInfo after data is present."""
216216
tag = uid()
217-
client.cypher("CREATE (n:GetLabelsTest {tag: $tag})", params={"tag": tag})
217+
label_name = f"GetLabelsTest{uid()}"
218+
client.cypher(f"CREATE (n:{label_name} {{tag: $tag}})", params={"tag": tag})
218219
try:
219220
labels = client.get_labels()
220221
assert isinstance(labels, list)
221222
assert len(labels) > 0
222223
assert all(isinstance(lbl, LabelInfo) for lbl in labels)
223224
names = [lbl.name for lbl in labels]
224-
assert "GetLabelsTest" in names, f"GetLabelsTest not in {names}"
225+
assert label_name in names, f"{label_name} not in {names}"
225226
finally:
226-
client.cypher("MATCH (n:GetLabelsTest {tag: $tag}) DELETE n", params={"tag": tag})
227+
client.cypher(f"MATCH (n:{label_name} {{tag: $tag}}) DELETE n", params={"tag": tag})
227228

228229

229230
def test_get_labels_has_property_definitions(client):
@@ -244,8 +245,9 @@ def test_get_labels_has_property_definitions(client):
244245
def test_get_edge_types_returns_list(client):
245246
"""get_edge_types() returns a non-empty list of EdgeTypeInfo after data is present."""
246247
tag = uid()
248+
edge_type = f"GET_EDGE_TYPE_TEST_{uid()}".upper()
247249
client.cypher(
248-
"CREATE (a:EdgeTypeTestNode {tag: $tag})-[:GET_EDGE_TYPE_TEST]->(b:EdgeTypeTestNode {tag: $tag})",
250+
f"CREATE (a:EdgeTypeTestNode {{tag: $tag}})-[:{edge_type}]->(b:EdgeTypeTestNode {{tag: $tag}})",
249251
params={"tag": tag},
250252
)
251253
try:
@@ -254,7 +256,7 @@ def test_get_edge_types_returns_list(client):
254256
assert len(edge_types) > 0
255257
assert all(isinstance(et, EdgeTypeInfo) for et in edge_types)
256258
type_names = [et.name for et in edge_types]
257-
assert "GET_EDGE_TYPE_TEST" in type_names, f"GET_EDGE_TYPE_TEST not in {type_names}"
259+
assert edge_type in type_names, f"{edge_type} not in {type_names}"
258260
finally:
259261
client.cypher("MATCH (n:EdgeTypeTestNode {tag: $tag}) DETACH DELETE n", params={"tag": tag})
260262

@@ -281,7 +283,7 @@ def test_traverse_returns_neighbours(client):
281283

282284

283285
@pytest.mark.xfail(
284-
strict=True,
286+
strict=False,
285287
reason="CoordiNode Traverse RPC does not yet support inbound direction — server returns empty result set",
286288
)
287289
def test_traverse_inbound_direction(client):

0 commit comments

Comments
 (0)