Repository navigation
Commit 200570c
committed
test(spanner): consolidate admin system tests to reduce DDL and database churn
Consolidate administrative system tests in `test_database_api.py` to eliminate
redundant database creations, long-running operations (LROs), and schema churn:
1. Consolidate Create & Update Tests:
- Combine PITR database creation and subsequent DDL update into a single
test (`test_create_and_update_database_pitr`), asserting both client
properties and Information Schema catalog values.
- Combine default leader creation and subsequent update into a single
multi-region database test (`test_create_and_update_database_with_default_leader`).
- Merge `test_update_ddl_w_operation_id` into `test_create_database_and_update_ddl`.
2. Consolidate Database Roles & Permissions:
- Merge `test_create_role_grant_access_success` and `test_list_database_role_success`
into `test_create_role_grant_access_and_list_roles`.
- Strip the 20-table schema down to only the single required table (`contacts`).
- Eliminate redundant teardown DDL (revoking permissions and dropping roles)
immediately prior to database deletion.
- Fix a lazy evaluation bug where the parent role query was never iterated
and therefore never dispatched over the wire.
3. Remove Pure Server-Side DDL Parser Tests:
- Drop `test_create_database_pitr_invalid_retention_period` and
`test_update_ddl_w_pitr_invalid`, which tested Spanner backend syntax
rejection of '0d' rather than client validation logic.
4. Fix Multi-Region Database Timeout:
- Replace the hardcoded 30-second timeout on multi-region database creation
with `DBAPI_OPERATION_TIMEOUT` (240s) to prevent CI flakes under load.
Savings:
- Eliminates 5 full database creations and drops (including 1 multi-region DB).
- Eliminates ~8 long-running DDL operations.1 parent 3c5919a commit 200570c
1 file changed
Lines changed: 96 additions & 226 deletions
0 commit comments