test: move handler handler tests to testcontainers db#1782
Merged
Conversation
a22cc20 to
19ef30d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the handlers_test suite to exercise HTTP handlers against the real Postgres-backed database.Client (via the shared testcontainers Postgres harness), and removes the now-unused in-memory fake DB implementation.
Changes:
- Switch handler tests to use a shared testcontainers Postgres database via a new
setupTestDBClienthelper andTestMain. - Update tests to use real DB behaviors/APIs (e.g., tool refresh, task storage/response types).
- Delete the
go/core/internal/database/fakein-memory client implementation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go/core/internal/httpserver/handlers/toolservers_test.go | Uses setupTestDBClient and real DB tool discovery refresh instead of fake tool insertion. |
| go/core/internal/httpserver/handlers/sessions_test.go | Uses setupTestDBClient; updates task creation/assertions to use protocol.Task with real DB storage. |
| go/core/internal/httpserver/handlers/memory_test.go | Uses setupTestDBClient to back memory handler tests with Postgres/pgvector. |
| go/core/internal/httpserver/handlers/database_test.go | Adds TestMain + setupTestDBClient for shared containerized Postgres and per-test truncation. |
| go/core/internal/httpserver/handlers/agents_test.go | Switches to setupTestDBClient in handler setup (removes fake DB client usage). |
| go/core/internal/database/fake/client.go | Removes the unused in-memory fake DB client implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
iplay88keys
reviewed
Apr 30, 2026
iplay88keys
previously approved these changes
Apr 30, 2026
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
19ef30d to
15ab180
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing