feat(db): shared test suite + migration tool (Phase 4 & 5)#192
Merged
Conversation
…169) - Add tests/common.rs: 10 shared test functions covering all major ops - project_crud (create, read, update, rotate, archive, delete) - issue_upsert_dedup (fingerprint dedup, count increment, status) - event_operations (insert, list, pagination, raw fetch) - auth_and_sessions (user CRUD, session lifecycle, expiry cleanup) - auth_attempts (brute-force tracking, email + IP counting) - alert_rules (CRUD, toggle, history, cooldown) - search (LIKE/ILIKE, level filter, count) - retention (purge, orphan cleanup) - count_table (whitelist validation) - ping (health check) - Add tests/sqlite_backend.rs: runs all shared tests on in-memory SQLite - Add tests/postgres_backend.rs: runs all shared tests on live Postgres (skipped if TEST_POSTGRES_URL not set) - SQLite: 11/11 tests pass - Postgres: compiles clean, tests gated behind env var Closes #169
…est suite (Phase 4, #169) Phase 4 — Shared test suite (#169): - tests/common.rs: 10 backend-agnostic test functions - tests/sqlite_backend.rs: 11/11 pass on in-memory SQLite - tests/postgres_backend.rs: gated behind TEST_POSTGRES_URL Phase 5 — Migration tool (#170): - trapfalld/src/migrate.rs: export/import/verify commands - CLI: trapfall db export/import/verify subcommands - docs/guide/migration.md: step-by-step migration guide - VitePress sidebar updated Closes #169, closes #170
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
Completes the Multi-Backend Database epic (#171) — Phase 4 and Phase 5.
Closes #169, closes #170.
Phase 4: Shared Test Suite (#169)
Backend-agnostic tests that run identically against SQLite and Postgres:
project_crudissue_upsert_dedupevent_operationsauth_and_sessionsauth_attemptsalert_rulessearchretentioncount_tablepingTEST_POSTGRES_URLPhase 5: Migration Tool (#170)
trapfalld/src/migrate.rs— export/import/verify logicDb { Export, Import, Verify }subcommandsdocs/guide/migration.md— step-by-step guideTest Plan
cargo fmt --check— cleancargo clippy --all-targets -- -D warnings— zero warningscargo test --workspace— all passEpic #171 Status