Skip to content

Commit 880e75f

Browse files
committed
feat: rewrite controlplane integration tests with pytest
1 parent 2afa155 commit 880e75f

4 files changed

Lines changed: 90 additions & 362 deletions

File tree

.github/workflows/integration-testing.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,15 @@ jobs:
118118
extra-deps: ""
119119
ignore: ""
120120
# TODO: expand to full tests_integ/memory once test stability is addressed
121-
- group: memory
121+
- group: memory-controlplane
122+
path: tests_integ/memory/test_controlplane.py
123+
timeout: 10
124+
extra-deps: "pytest-order"
125+
ignore: ""
126+
- group: memory-client
122127
path: tests_integ/memory/test_memory_client.py
123128
timeout: 10
124-
extra-deps: ""
129+
extra-deps: "pytest-order"
125130
ignore: ""
126131
- group: evaluation
127132
path: tests_integ/evaluation

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ dev = [
144144
"pytest>=8.4.1",
145145
"pytest-asyncio>=0.24.0",
146146
"pytest-cov>=6.0.0",
147+
"pytest-order>=1.3.0",
147148
"ruff>=0.12.0",
148149
"websockets>=14.1",
149150
"wheel>=0.45.1",

tests_integ/memory/helpers.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import time
2+
3+
import pytest
4+
5+
6+
def poll_until(fn, predicate, max_wait=180, poll_interval=10, fail_if=None):
7+
"""Poll fn() until predicate(result) is True or max_wait exceeded."""
8+
deadline = time.time() + max_wait
9+
while time.time() < deadline:
10+
result = fn()
11+
if fail_if and fail_if(result):
12+
pytest.fail(f"poll_until hit terminal state: {result}")
13+
if predicate(result):
14+
return result
15+
time.sleep(poll_interval)
16+
pytest.fail(f"poll_until timed out after {max_wait}s")

0 commit comments

Comments
 (0)