Skip to content

test: migrate Explore controller sessions and ORM models to SQLite - #40537

Open
asukaminato0721 wants to merge 1 commit into
langgenius:mainfrom
asukaminato0721:agent/sqlite-orm-explore-controllers
Open

test: migrate Explore controller sessions and ORM models to SQLite#40537
asukaminato0721 wants to merge 1 commit into
langgenius:mainfrom
asukaminato0721:agent/sqlite-orm-explore-controllers

Conversation

@asukaminato0721

@asukaminato0721 asukaminato0721 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace mocked SQLAlchemy sessions in Explore audio, completion, message, parameter, saved-message, trial, and workflow controller tests with shared SQLite-backed sessions

  • replace App, InstalledApp, AppModelConfig, Workflow, Message, MessageFeedback, Account, Dataset, Tenant, and UploadFile stand-ins with real mapped instances

  • persist ownership/resource chains needed by secondary serializer queries while retaining mocks only for external services, DTO/Pydantic responses, pagination, Redis, crypto, and file-provider objects

Real persistence coverage

  • callable Flask db.session behavior through scoped sessions backed by sqlite_session_factory
  • injected controller sessions through sqlite_session/unbound_session according to ownership
  • installed-app to app resolution, workflow/config lookup, message feedback and file queries, tenant/app ownership, and committed model defaults
  • missing app/config/workflow behavior through actual database lookups

No production changes.

Size

725 additions + 439 deletions = 1,164 changed lines.

Validation

  • make test TARGET_TESTS=./api/tests/unit_tests/controllers/console/explore — 234 passed
  • uv run --project . pytest -q --no-cov — 171 passed
  • make lint — passed
  • make type-check — blocked by mypy 1.20.2 internal error at api/.venv/lib/python3.12/site-packages/mypy/typeshed/stdlib/zipimport.pyi:17
  • AST/text audit — no mocked SQLAlchemy sessions/factories and no mapped ORM stand-ins remain in the changed modules

The full test suite was not run, per request.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 58.89% 58.93% +0.03%
Strict coverage 58.47% 58.51% +0.03%
Typed symbols 38,907 38,937 +30
Untyped symbols 27,351 27,333 -18
Modules 3143 3143 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant