Skip to content

test: add source-audit tests for the async DoclingLoader rework#8

Draft
jannefleischer wants to merge 1 commit into
open-webui:mainfrom
jannefleischer:feat-docling-loader-async
Draft

test: add source-audit tests for the async DoclingLoader rework#8
jannefleischer wants to merge 1 commit into
open-webui:mainfrom
jannefleischer:feat-docling-loader-async

Conversation

@jannefleischer

Copy link
Copy Markdown

THIS IS MOSTLY DONE BY AI. I am an urban planner having (almost) no understanding of the inner workings of tests...

This relies on PR open-webui/open-webui#26947 (which is part of discussion in open-webui/open-webui#26931)

Covers the DoclingLoader rework that replaces the old blocking /v1/convert/file call with submit (/v1/convert/file/async) -> long-poll (/v1/status/poll/{task_id}) -> retrieve (/v1/result/{task_id}), plus:

  • optional overall timeout (DOCLING_SERVE_TIMEOUT), wired end-to-end from config.py through LOADER_CONFIG_KEYS/RETRIEVAL_CONFIG_KEYS, ConfigForm, and update_rag_config
  • optional status_callback hook invoked on submit and on task_position updates while polling
  • load_from_task_id() to resume an already-submitted task without re-uploading
  • Loader.aload()'s 'docling' dispatch branch threading timeout and status_callback into DoclingLoader, with defensive int coercion

Source-level tests (regex-match the actual backend source via the open_webui_backend fixture) rather than importing
open_webui.retrieval.loaders.main directly, since that module pulls in a dependency tree (typer, langchain_community, azure.identity, ftfy) not present in this repo's test environment — same approach already used for the knowledge-status tests.

Verified: all 20 tests pass against the feat-docling-loader-async source branch, and all 20 correctly fail against the pre-feature base commit (10724d057), confirming they're discriminating regression guards rather than tautologies.

Covers the DoclingLoader rework that replaces the old blocking
/v1/convert/file call with submit (/v1/convert/file/async) -> long-poll
(/v1/status/poll/{task_id}) -> retrieve (/v1/result/{task_id}), plus:

- optional overall timeout (DOCLING_SERVE_TIMEOUT), wired end-to-end
  from config.py through LOADER_CONFIG_KEYS/RETRIEVAL_CONFIG_KEYS,
  ConfigForm, and update_rag_config
- optional status_callback hook invoked on submit and on task_position
  updates while polling
- load_from_task_id() to resume an already-submitted task without
  re-uploading
- Loader.aload()'s 'docling' dispatch branch threading timeout and
  status_callback into DoclingLoader, with defensive int coercion

Source-level tests (regex-match the actual backend source via the
open_webui_backend fixture) rather than importing
open_webui.retrieval.loaders.main directly, since that module pulls in
a dependency tree (typer, langchain_community, azure.identity, ftfy)
not present in this repo's test environment — same approach already
used for the knowledge-status tests.

Verified: all 20 tests pass against the feat-docling-loader-async
source branch, and all 20 correctly fail against the pre-feature base
commit (10724d057), confirming they're discriminating regression
guards rather than tautologies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant