Ensure schemas are up-to-date after migration tests complete
If a CI migration leaves the database behind the current database schema, we need to ensure that the schema is brought up-to-date after the migrations run to prevent other tests from starting from an inconsistent state. This commit consolidates the database cleanup for multiple databases by ensuring: 1. After a migration context is complete, either recreate the databases (if the number of columns approaches the max) or migrate all the schemas back to the latest and drop all data from both databases. 2. After a migration example runs, delete any leftover data for that specific database. If a CI migration leaves the database behind the current database schema, we need to ensure that the schema is brought up-to-date after the migrations run to prevent putting other tests in an inconsistent state. Related MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/100233 Closes https://gitlab.com/gitlab-org/gitlab/-/issues/377796 Changelog: fixed
显示
- spec/migrations/change_public_projects_cost_factor_spec.rb 0 个添加, 2 个删除spec/migrations/change_public_projects_cost_factor_spec.rb
- spec/support/database/multiple_databases.rb 36 个添加, 2 个删除spec/support/database/multiple_databases.rb
- spec/support/database_cleaner.rb 0 个添加, 23 个删除spec/support/database_cleaner.rb
- spec/support/db_cleaner.rb 13 个添加, 0 个删除spec/support/db_cleaner.rb
- spec/support/migration.rb 0 个添加, 4 个删除spec/support/migration.rb
加载中
想要评论请 注册 或 登录