Skip to content

test: move handler handler tests to testcontainers db#1782

Merged
EItanya merged 1 commit intomainfrom
handler-tests-use-testcontainers-db
Apr 30, 2026
Merged

test: move handler handler tests to testcontainers db#1782
EItanya merged 1 commit intomainfrom
handler-tests-use-testcontainers-db

Conversation

@EItanya
Copy link
Copy Markdown
Contributor

@EItanya EItanya commented Apr 30, 2026

Summary

  • switch HTTP handler tests from the in-memory fake database client to the shared Postgres testcontainers setup
  • add a shared database-backed test helper for the handlers test package
  • delete the unused fake database implementation

Testing

  • go test ./core/internal/httpserver/handlers/...

Copilot AI review requested due to automatic review settings April 30, 2026 14:48
@github-actions github-actions Bot added the testing Additional testing required label Apr 30, 2026
@EItanya EItanya force-pushed the handler-tests-use-testcontainers-db branch from a22cc20 to 19ef30d Compare April 30, 2026 14:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 setupTestDBClient helper and TestMain.
  • Update tests to use real DB behaviors/APIs (e.g., tool refresh, task storage/response types).
  • Delete the go/core/internal/database/fake in-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.

Comment thread go/core/internal/httpserver/handlers/sessions_test.go Outdated
Comment thread go/core/internal/httpserver/handlers/database_test.go Outdated
Comment thread go/core/internal/httpserver/handlers/database_test.go Outdated
iplay88keys
iplay88keys previously approved these changes Apr 30, 2026
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@EItanya EItanya force-pushed the handler-tests-use-testcontainers-db branch from 19ef30d to 15ab180 Compare April 30, 2026 15:43
@EItanya EItanya merged commit 83add15 into main Apr 30, 2026
23 checks passed
@EItanya EItanya deleted the handler-tests-use-testcontainers-db branch April 30, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Additional testing required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants