Skip to content

Studio tests: skip rag_conn where this Python's sqlite3 cannot load extensions - #15862

Merged
danielhanchen merged 1 commit into
mainfrom
tests-rag-conn-skips-without-extension-loading
Oct 28, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
tests-rag-conn-skips-without-extension-loading

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

The macos-15 cross-platform leg on #15859 ran studio/backend/tests/test_rag_store.py, because that PR changes it, and got 4 passed, 24 errors:

E   AttributeError: 'GatedConnection' object has no attribute 'enable_load_extension'
E   storage.rag_db.RagExtensionUnavailable: RAG unavailable: sqlite-vec extension could not be loaded

#15859 is not at fault here. Every one of the 24 errors is in the rag_conn fixture.

Cause

The Python on the macOS runner has a sqlite3 built without loadable-extension support: sqlite3.Connection has no enable_load_extension at all. On such an interpreter RAG can never load sqlite-vec. The product handles that: get_connection raises RagExtensionUnavailable and Studio reports RAG as unavailable.

The RAG tests that open a connection themselves already skip on exactly this condition (test_rag_wal_keeper.py, test_rag_delete_document_scan.py, test_account_storage.py, test_rag_unavailable_quiet.py):

not rag_db.RAG_AVAILABLE or not hasattr(sqlite3.Connection, "enable_load_extension")

The shared rag_conn fixture in studio/backend/tests/conftest.py did not. So any of the 17 files built on it errors on that leg as soon as a PR touches it.

Fix

rag_conn skips on the same condition before opening the connection. Nothing else changes. On an interpreter that can load extensions, a sqlite-vec that fails to load still raises out of the fixture, so a real breakage is not turned into a skip.

Verification

To reproduce on Linux, a pytest plugin stands in for that interpreter: sqlite3.Connection without enable_load_extension, and connections that raise AttributeError for it.

run main 06314b97dd this branch
test_rag_store.py, normal 27 passed 27 passed
test_rag_store.py, no-extension interpreter 4 passed, 23 errors (the CI failure) 4 passed, 23 skipped
test_rag_store.py, extension loading works but sqlite_vec.load raises 4 passed, 23 errors 4 passed, 23 errors (still fails, as it should)
the 17 files that use rag_conn, normal, -n 8 634 passed, 18 skipped

Not covered here

rag_conn is the shared fixture, but many RAG tests reach rag_db.get_connection() through the ingest and upload paths instead. Under the same simulated interpreter, about 25 other files still fail, among them test_rag_ingestion.py, test_rag_upload_formats.py, test_rag_linked_folders.py and test_rag_embedding_identity.py. The simulation overstates this a little: module-level skipifs are evaluated before the plugin patches sqlite3.

Those files would fail on the macOS leg only when a PR changes them. The cleaner end state is a macOS leg whose Python can load sqlite extensions, rather than skipping RAG coverage there. That is a separate change to the harness.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T22:46:57.469116Z 4293583 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 4293583f94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 9a9d5f5 into main Oct 28, 2026
3 of 37 checks passed
@danielhanchen
danielhanchen deleted the tests-rag-conn-skips-without-extension-loading branch October 28, 2026 22:53
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