mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-06 22:12:12 +02:00
test: rename SearchSpace -> Workspace across tests + fixtures (Phase 2 Wave F)
Apply the same rename to surfsense_backend/tests: workspace_id fields/vars, Workspace* classes/schemas, table name searchspaces -> workspaces in raw SQL, and the API URL spellings -> /workspaces. Preserves the carve-out wire literals tests assert (Celery task names, OTel key "search_space.id").
This commit is contained in:
parent
56826a63bc
commit
ca9bd28934
124 changed files with 1269 additions and 1269 deletions
|
|
@ -170,7 +170,7 @@ class TestMetricHelpers:
|
|||
metrics.record_tool_call_error(tool_name="web_search")
|
||||
metrics.record_kb_search_duration(
|
||||
4.0,
|
||||
search_space_id=1,
|
||||
workspace_id=1,
|
||||
surface="documents",
|
||||
)
|
||||
metrics.record_compaction_run(reason="auto")
|
||||
|
|
@ -250,7 +250,7 @@ class TestNoopSpansWhenDisabled:
|
|||
helpers = [
|
||||
otel.tool_call_span("write_file", input_size=42),
|
||||
otel.model_call_span(model_id="openai:gpt-4o", provider="openai"),
|
||||
otel.kb_search_span(search_space_id=1, query_chars=99),
|
||||
otel.kb_search_span(workspace_id=1, query_chars=99),
|
||||
otel.kb_persist_span(document_type="NOTE", document_id=7),
|
||||
otel.compaction_span(reason="overflow", messages_in=120),
|
||||
otel.interrupt_span(interrupt_type="permission_ask"),
|
||||
|
|
|
|||
|
|
@ -48,14 +48,14 @@ async def test_retriever_wrapper_records_one_span_and_metric(monkeypatch) -> Non
|
|||
self,
|
||||
query_text: str,
|
||||
top_k: int,
|
||||
search_space_id: int,
|
||||
workspace_id: int,
|
||||
) -> list[str]:
|
||||
del query_text, top_k, search_space_id
|
||||
del query_text, top_k, workspace_id
|
||||
return ["doc-1", "doc-2"]
|
||||
|
||||
result = await Retriever().search("hello", 3, 42)
|
||||
|
||||
assert result == ["doc-1", "doc-2"]
|
||||
assert len(calls) == 1
|
||||
assert calls[0]["search_space_id"] == 42
|
||||
assert calls[0]["workspace_id"] == 42
|
||||
assert calls[0]["surface"] == "documents"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue