test: split embedding lane tests (#4389)

* test: split embedding lane tests

* test: preserve embedding focus selector after lane split
This commit is contained in:
Alexandre Teixeira
2026-06-26 17:28:40 +01:00
committed by GitHub
parent fc1351d0f8
commit 62a23ca4aa
10 changed files with 947 additions and 825 deletions
+51
View File
@@ -41,10 +41,24 @@ def test_sub_area_only_marker_expression():
assert build_marker_expression(None, "cookbook") == "sub_cookbook"
def test_embedding_sub_area_marker_expression_includes_memory_split():
assert (
build_marker_expression(None, "embedding")
== "(sub_embedding or sub_embedding_memory)"
)
def test_area_and_sub_area_marker_expression():
assert build_marker_expression("services", "cookbook") == "area_services and sub_cookbook"
def test_area_and_embedding_sub_area_marker_expression_includes_memory_split():
assert (
build_marker_expression("services", "embedding")
== "area_services and (sub_embedding or sub_embedding_memory)"
)
def test_no_selection_marker_expression_is_none():
assert build_marker_expression(None, None) is None
@@ -75,6 +89,12 @@ def test_sub_area_only_command():
assert _cmd(sub_area="cookbook") == [PY, "-m", "pytest", "-m", "sub_cookbook"]
def test_embedding_sub_area_command_includes_memory_split():
assert _cmd(sub_area="embedding") == [
PY, "-m", "pytest", "-m", "(sub_embedding or sub_embedding_memory)",
]
def test_area_and_sub_area_command():
assert _cmd(area="services", sub_area="cookbook") == [
PY, "-m", "pytest", "-m", "area_services and sub_cookbook",
@@ -130,6 +150,13 @@ def test_fast_with_area_and_sub_area_command():
]
def test_fast_with_embedding_sub_area_command_includes_memory_split():
assert _cmd(sub_area="embedding", fast=True) == [
PY, "-m", "pytest", "-m",
"(sub_embedding or sub_embedding_memory) and not slow",
]
def test_durations_appends_flag():
assert _cmd(fast=True, durations=25) == [
PY, "-m", "pytest", "-m", "not slow", "--durations=25",
@@ -252,6 +279,30 @@ def test_run_accepts_both_sub_area_forms(value):
]]
def test_run_keeps_embedding_memory_selector_specific():
executor = _FakeExecutor()
run(["--sub-area", "embedding_memory"], executor=executor)
assert executor.calls == [[
sys.executable,
"-m",
"pytest",
"-m",
"sub_embedding_memory",
]]
def test_run_expands_embedding_selector_to_memory_split():
executor = _FakeExecutor()
run(["--sub-area", "embedding"], executor=executor)
assert executor.calls == [[
sys.executable,
"-m",
"pytest",
"-m",
"(sub_embedding or sub_embedding_memory)",
]]
def test_invalid_area_exits_with_error():
with pytest.raises(SystemExit) as excinfo:
run(["--area", "bogus"], executor=_FakeExecutor())