Skip to content

test(db): add unit tests for db migrate URL validation branches #2377

@bug-ops

Description

@bug-ops

Context

src/commands/db.rs contains two #[cfg(feature)] URL validation branches:

  • #[cfg(feature = "postgres")] — rejects non-postgres URLs
  • #[cfg(feature = "sqlite")] — rejects postgres URLs

These branches are not covered by any unit tests because they require compile-time feature selection, making them invisible to the default test run.

Acceptance Criteria

  • Unit tests for the postgres validation branch compiled under --features postgres
  • Unit tests for the sqlite validation branch (default features)
  • Both happy-path and error-path covered
  • Tests added to src/commands/db.rs #[cfg(test)] block

Notes

The fix lives in src/commands/db.rs. The validation uses zeph_db::is_postgres_url() which is already unit-tested in zeph-db. These tests would verify the integration with handle_db_migrate().

Metadata

Metadata

Assignees

Labels

P2High value, medium complexitytestingTests and quality

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions