fix: Update integration.test.ts#1737
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Vitest integration test timeout to reduce flakiness when running against a real OpenRAG instance, where document ingestion + indexing + retrieval can exceed the previous limit.
Changes:
- Increased the per-test timeout for the “filterId in chat actually scopes retrieval to data_sources” integration test from 60s to 120s.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a0d4ac4
into
pr-1666-filter-id-main
* missed filter_id fixes * unit test * clarify filter comments * Use bracket notation for document body keys (#1734) Change assignments to the request body to use bracket notation (body['filename'], body['filter_id']) instead of dot notation. This ensures the string keys are set explicitly on the Record<string, string> and avoids relying on declared property names. * fix: Update integration.test.ts (#1737) --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* missed filter_id fixes * unit test * clarify filter comments * Use bracket notation for document body keys (#1734) Change assignments to the request body to use bracket notation (body['filename'], body['filter_id']) instead of dot notation. This ensures the string keys are set explicitly on the Record<string, string> and avoids relying on declared property names. * fix: Update integration.test.ts (#1737) --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> (cherry picked from commit db9ae7f)
* fix: Add filter_id support and v1 filter resolution (#1666) * Add filter_id support and v1 filter resolution Add server-side resolution for filter_id and extend document deletion to accept a filter_id. Introduces api.v1._filter_resolution to normalize a filter_id into concrete filters/limits/score_thresholds and to strip wildcards. v1 endpoints (chat, search, documents) now accept filter_id and merge resolved values with inline overrides; documents DELETE can delete all filenames referenced by a filter_id (with wildcard/empty data_sources rejected to avoid mass deletion). SDK updates (Python and TypeScript) allow DocumentsClient.delete to accept either filename or filter_id (mutually exclusive), include additional response fields (filenames, filter_id, per_file), and preserve idempotent semantics for filename deletes while surfacing filter-not-found errors. Tests updated/added to cover filter_id behavior, inline overrides, streaming, and validation. Additional minor logging/validation and type updates included. * style: ruff autofix (auto) * Clarify /v1/documents DELETE description Expand the DELETE /v1/documents component description to indicate it can delete single or multiple documents and requires exactly one of `filename` or `filter_id`. Also notes that wildcards are rejected for safety, improving API documentation and removing ambiguity about deletion semantics. * style: ruff autofix (auto) * fix lint * style: ruff autofix (auto) * Set auth context for API-key search requests Ensure API-key authenticated searches set the auth context and pass the user's JWT to the search service so downstream tools can resolve the user. Adds import for set_auth_context, calls it when handling API-key requests (mirroring v1 chat), and passes user.jwt_token to search_service.search instead of None. Also cleans up an unused typing import. * Exclude ingest route; expose /v1 GETs as tools Clarify search component docs to document `filter_id` and inline `filters` (inline filters override per-field). Document that /v1/documents/ingest is intentionally not customized/exposed via MCP because multipart/form-data uploads are not supported by FastMCP's from_fastapi conversion; clients should use the HTTP API or SDK to ingest. Add a RouteMap to explicitly exclude POST /v1/documents/ingest and consolidate route maps to expose all /v1/ routes (including GET) as MCP tools, with a note explaining that GETs are exposed as tools to better support LLM agent workflows. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> (cherry picked from commit eda6aaf) * fix: more filter_id issues (#1730) * missed filter_id fixes * unit test * clarify filter comments * Use bracket notation for document body keys (#1734) Change assignments to the request body to use bracket notation (body['filename'], body['filter_id']) instead of dot notation. This ensures the string keys are set explicitly on the Record<string, string> and avoids relying on declared property names. * fix: Update integration.test.ts (#1737) --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> (cherry picked from commit db9ae7f) * Update documents.ts * test: raise TS SDK filter-scope test timeouts and parallelize ingests The "filterId in chat actually scopes retrieval to data_sources" integration test was timing out at 60s and failing CI on every run. The chat itself works (backend logs show the response generated in ~7.6s); the 60s budget was consumed by two sequential Docling ingests (~25s each in CI) plus the filter create before the chat even started, so the test crossed the deadline. Bump the three ingest-heavy filter-scope tests (chat, search, delete-by-filter) to a 180s per-test timeout and ingest the two docs concurrently via Promise.all to shorten the critical path. Raise the global vitest testTimeout 60s -> 120s so lighter tests have headroom too. The Python equivalent already passes because pytest imposes no per-test cap; no backend/SDK behavior changes. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Sebastián Estévez <estevezsebastian@gmail.com>
* fix: Add filter_id support and v1 filter resolution (#1666) * Add filter_id support and v1 filter resolution Add server-side resolution for filter_id and extend document deletion to accept a filter_id. Introduces api.v1._filter_resolution to normalize a filter_id into concrete filters/limits/score_thresholds and to strip wildcards. v1 endpoints (chat, search, documents) now accept filter_id and merge resolved values with inline overrides; documents DELETE can delete all filenames referenced by a filter_id (with wildcard/empty data_sources rejected to avoid mass deletion). SDK updates (Python and TypeScript) allow DocumentsClient.delete to accept either filename or filter_id (mutually exclusive), include additional response fields (filenames, filter_id, per_file), and preserve idempotent semantics for filename deletes while surfacing filter-not-found errors. Tests updated/added to cover filter_id behavior, inline overrides, streaming, and validation. Additional minor logging/validation and type updates included. * style: ruff autofix (auto) * Clarify /v1/documents DELETE description Expand the DELETE /v1/documents component description to indicate it can delete single or multiple documents and requires exactly one of `filename` or `filter_id`. Also notes that wildcards are rejected for safety, improving API documentation and removing ambiguity about deletion semantics. * style: ruff autofix (auto) * fix lint * style: ruff autofix (auto) * Set auth context for API-key search requests Ensure API-key authenticated searches set the auth context and pass the user's JWT to the search service so downstream tools can resolve the user. Adds import for set_auth_context, calls it when handling API-key requests (mirroring v1 chat), and passes user.jwt_token to search_service.search instead of None. Also cleans up an unused typing import. * Exclude ingest route; expose /v1 GETs as tools Clarify search component docs to document `filter_id` and inline `filters` (inline filters override per-field). Document that /v1/documents/ingest is intentionally not customized/exposed via MCP because multipart/form-data uploads are not supported by FastMCP's from_fastapi conversion; clients should use the HTTP API or SDK to ingest. Add a RouteMap to explicitly exclude POST /v1/documents/ingest and consolidate route maps to expose all /v1/ routes (including GET) as MCP tools, with a note explaining that GETs are exposed as tools to better support LLM agent workflows. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> (cherry picked from commit eda6aaf) * fix: more filter_id issues (#1730) * missed filter_id fixes * unit test * clarify filter comments * Use bracket notation for document body keys (#1734) Change assignments to the request body to use bracket notation (body['filename'], body['filter_id']) instead of dot notation. This ensures the string keys are set explicitly on the Record<string, string> and avoids relying on declared property names. * fix: Update integration.test.ts (#1737) --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> (cherry picked from commit db9ae7f) * Update documents.ts * test: raise TS SDK filter-scope test timeouts and parallelize ingests The "filterId in chat actually scopes retrieval to data_sources" integration test was timing out at 60s and failing CI on every run. The chat itself works (backend logs show the response generated in ~7.6s); the 60s budget was consumed by two sequential Docling ingests (~25s each in CI) plus the filter create before the chat even started, so the test crossed the deadline. Bump the three ingest-heavy filter-scope tests (chat, search, delete-by-filter) to a 180s per-test timeout and ingest the two docs concurrently via Promise.all to shorten the critical path. Raise the global vitest testTimeout 60s -> 120s so lighter tests have headroom too. The Python equivalent already passes because pytest imposes no per-test cap; no backend/SDK behavior changes. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Sebastián Estévez <estevezsebastian@gmail.com>
increase timeout