test(db): strengthen the zone_name DROP COLUMN migration tests #261

Open
opened 2026-10-03 10:45:41 +00:00 by gabogg · 0 comments
Owner

P3 follow-up from PR #234 review pass 2 (both axes).

Finding

  • The injected failure fires too early. It triggers at the DROP COLUMN statement (tests/test_camera_schema_migration.py:152), so nothing has changed yet when it fails. #209 says "If the copy fails partway, the original table and data survive". A reviewer's probe shows that a failure after the DROP (at idx_cycles_door_time or the provenance UPDATE) rolls back correctly, but no test covers it.
  • REAL_LEGACY_DDL isn't the real legacy definition (:12-29). It already has is_excluded, a resource_group_code FK and a camera_groups table, so the suite never runs DROP followed by the ADD COLUMN migrations on the true ce0ff5d schema.
  • FailingConnection.execute has no user. No test sends its failure point through conn.execute.

Acceptance Criteria

  • Inject a failure after the DROP and assert that the column and rows survive.
  • Use the exact ce0ff5d DDL, or rename the fixture to say what it is.
  • Delete the unused override.
P3 follow-up from PR #234 review pass 2 (both axes). ### Finding - **The injected failure fires too early.** It triggers *at* the `DROP COLUMN` statement (`tests/test_camera_schema_migration.py:152`), so nothing has changed yet when it fails. #209 says *"If the copy fails partway, the original table and data survive"*. A reviewer's probe shows that a failure *after* the DROP (at `idx_cycles_door_time` or the provenance UPDATE) rolls back correctly, but no test covers it. - **`REAL_LEGACY_DDL` isn't the real legacy definition** (:12-29). It already has `is_excluded`, a `resource_group_code` FK and a `camera_groups` table, so the suite never runs DROP followed by the ADD COLUMN migrations on the true `ce0ff5d` schema. - **`FailingConnection.execute` has no user.** No test sends its failure point through `conn.execute`. ### Acceptance Criteria - Inject a failure after the DROP and assert that the column and rows survive. - Use the exact `ce0ff5d` DDL, or rename the fixture to say what it is. - Delete the unused override.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gabogg/hikcentral#261
No description provided.