-
Notifications
You must be signed in to change notification settings - Fork 2
test(db): add unit tests for db migrate URL validation branches #2377
Copy link
Copy link
Closed
Labels
P2High value, medium complexityHigh value, medium complexitytestingTests and qualityTests and quality
Description
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().
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2High value, medium complexityHigh value, medium complexitytestingTests and qualityTests and quality