Skip to content

test: migrate API and MCP e2e to multi-db#189

Merged
mergify[bot] merged 3 commits intomatrixorigin:mainfrom
gouhongshen:ghs/multidb-e2e-migration
Apr 17, 2026
Merged

test: migrate API and MCP e2e to multi-db#189
mergify[bot] merged 3 commits intomatrixorigin:mainfrom
gouhongshen:ghs/multidb-e2e-migration

Conversation

@gouhongshen
Copy link
Copy Markdown
Contributor

Summary

  • migrate the main API and MCP e2e suites onto shared multi-db test harnesses
  • add reusable API/MCP multi-db support helpers and expose an MCP e2e make target
  • fix multi-db-specific route, storage, and verification assumptions uncovered during validation

Validation

  • migrated API and MCP e2e suites onto the shared multi-db harness
  • compatibility-seeded old data and verified old API keys on the current multi-db server
  • exercised remaining API routes including search, correct, purge, snapshot rollback/delete, and branch merge/delete

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gouhongshen gouhongshen requested a review from XuPeng-SH as a code owner April 17, 2026 09:12
Copilot AI review requested due to automatic review settings April 17, 2026 09:12
Copy link
Copy Markdown

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 migrates the API and MCP end-to-end test suites to a shared multi-database test harness, adds reusable helpers for multi-db test setup/teardown, and adjusts API/storage behavior uncovered during multi-db validation.

Changes:

  • Introduce a reusable MultiDbTestContext harness (shared DB + routed user DBs) and wire MCP/API integration tests to use it.
  • Update storage/runtime SQL and ordering assumptions for multi-db correctness (including quoting reserved identifiers).
  • Add a make test-e2e-mcp target to run MCP E2E suites consistently against the test DB.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
memoria/crates/memoria-test-utils/src/lib.rs Adds MultiDbTestContext + DB URL helpers and cleanup logic for multi-db tests.
memoria/crates/memoria-test-utils/Cargo.toml Adds dependencies needed by the new multi-db test harness.
memoria/crates/memoria-storage/src/store.rs Adjusts governance SQL (task quoting) and changes lite listing sort order.
memoria/crates/memoria-mcp/tests/support/multi_db.rs New MCP test wrapper around MultiDbTestContext.
memoria/crates/memoria-mcp/tests/support/mod.rs Exposes MCP test support module.
memoria/crates/memoria-mcp/tests/snapshot_e2e.rs Migrates snapshot E2E to multi-db harness and fixes per-user snapshot expectations.
memoria/crates/memoria-mcp/tests/perf_optimizations_e2e.rs Migrates perf tests to multi-db harness and uses per-user qualified table names.
memoria/crates/memoria-mcp/tests/mcp_e2e.rs Migrates MCP tool E2E tests to multi-db harness.
memoria/crates/memoria-mcp/tests/integration_full.rs Migrates full-stack MCP integration test to multi-db harness and per-user pools.
memoria/crates/memoria-mcp/tests/graph_e2e.rs Migrates Graph E2E tests to multi-db harness and per-user stores/pools.
memoria/crates/memoria-mcp/tests/feedback_e2e.rs Migrates feedback E2E tests to multi-db harness; adds mock-embedder setup helper.
memoria/crates/memoria-mcp/tests/edit_log_e2e.rs Migrates edit-log E2E suite (including API-spawned server) to multi-db harness.
memoria/crates/memoria-mcp/tests/core_tools_e2e.rs Migrates core tools E2E suite to multi-db harness; updates get usage to get_for_user.
memoria/crates/memoria-mcp/tests/branch_e2e.rs Migrates branch E2E suite to multi-db harness and updates direct SQL/git assertions.
memoria/crates/memoria-api/tests/support/multi_db.rs Adds API test server harness built on MultiDbTestContext (spawn + shutdown).
memoria/crates/memoria-api/tests/support/mod.rs Exposes API test support module.
memoria/crates/memoria-api/tests/pool_isolation.rs Updates pool isolation test to use multi-db API server harness and routed pools.
memoria/crates/memoria-api/tests/api_db_verify.rs Migrates API DB verification tests to multi-db API server harness and per-user pools.
memoria/crates/memoria-api/src/routes/memory.rs Adds cross-user lookup helper for memory operations in multi-db setups.
memoria/crates/memoria-api/src/routes/admin.rs Extends global hygiene endpoint to aggregate per-user hygiene in multi-db mode.
memoria/Cargo.lock Updates lockfile for new test-utils dependencies.
Makefile Adds test-e2e-mcp make target to run MCP E2E suites.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread memoria/crates/memoria-storage/src/store.rs
Comment thread memoria/crates/memoria-api/src/routes/memory.rs Outdated
Comment thread memoria/crates/memoria-api/src/routes/memory.rs Outdated
Comment thread memoria/crates/memoria-api/src/routes/memory.rs Outdated
Comment thread memoria/crates/memoria-api/tests/pool_isolation.rs Outdated
gouhongshen and others added 2 commits April 17, 2026 17:36
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mergify
Copy link
Copy Markdown

mergify Bot commented Apr 17, 2026

Merge Queue Status

  • Entered queue2026-04-17 10:13 UTC · Rule: main
  • Checks skipped · PR is already up-to-date
  • Merged2026-04-17 10:13 UTC · at 6ee9d1bb312c015a18d7af70b1ee2282373684e5 · squash

This pull request spent 8 seconds in the queue, including 1 second running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Check PR title
    • check-neutral = Check PR title
    • check-skipped = Check PR title
  • any of [🛡 GitHub branch protection]:
    • check-success = Check & Clippy
    • check-neutral = Check & Clippy
    • check-skipped = Check & Clippy
  • any of [🛡 GitHub branch protection]:
    • check-success = DB Tests
    • check-neutral = DB Tests
    • check-skipped = DB Tests
  • any of [🛡 GitHub branch protection]:
    • check-success = Unit Tests
    • check-neutral = Unit Tests
    • check-skipped = Unit Tests

@mergify mergify Bot merged commit b34717d into matrixorigin:main Apr 17, 2026
6 checks passed
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.

3 participants