Skip to content
代码片段 群组 项目
提交 f55e3a26 编辑于 作者: Dylan Griffith's avatar Dylan Griffith
浏览文件

Automatically extract BBM spec schema from finalized_by

Since the `ensure_batched_background_migration_is_finished` call should
correspond to the latest version of the schema we need to support for a
given batched background migration we can assume that we can lock the
spec to only run against that schema.

Now that we have introduced a `finalized_by` key in our
`db/docs/batched_background_migrations/*.yml' files we can use this to
automatically work out what schema to use running tests for a batched
background migration.

This work is also to support an effort to automatically finalize a
lot of batched background migrations which ultimately is holding up
https://gitlab.com/gitlab-org/gitlab/-/issues/429165. Saving us the
effort of setting `schema` in the spec will simplify this work.

This merge request also updates a specific spec
migrate_human_user_type_spec just so that we have an example to
demonstrate this works. This migration is already finalized in
`db/post_migrate/20230523101514_finalize_user_type_migration.rb` so we
add that version number to the `db/docs` file for this migration job.
Without locking the version in this spec it fails due to new required
columns not being set. This demonstrates the new functionality to
automatically select the schema version works.

This MR also moves some logic out of `spec_helper` and into
`spec/support/helpers/migrations_helpers` because it makes more sense
there.
上级 20c89411
No related branches found
No related tags found
无相关合并请求
加载中
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册