mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
provision: Don't run migrations on zulip
db in CircleCI.
The automated tests running in CircleCI don't actually use the `zulip` db, so we can skip running migrations on it in some CircleCI shards to save time. NOTE: This only effects build jobs that run provision, except the `production-build` job where we skip building the dbs altogether. Migrations still run on `focal-backend` build job to ensure we are testing all our development setup code.
This commit is contained in:
@@ -253,8 +253,17 @@ def main(options: argparse.Namespace) -> int:
|
||||
dev_template_db_status = DEV_DATABASE.template_status()
|
||||
if options.is_force or dev_template_db_status == 'needs_rebuild':
|
||||
run(["tools/setup/postgres-init-dev-db"])
|
||||
run(["tools/rebuild-dev-database"])
|
||||
DEV_DATABASE.write_new_db_digest()
|
||||
if options.skip_dev_db_build:
|
||||
# We don't need to build the manual development
|
||||
# database on CircleCI for running tests, so we can
|
||||
# just leave it as a template db and save a minute.
|
||||
#
|
||||
# Important: We don't write a digest as that would
|
||||
# incorrectly claim that we ran migrations.
|
||||
pass
|
||||
else:
|
||||
run(["tools/rebuild-dev-database"])
|
||||
DEV_DATABASE.write_new_db_digest()
|
||||
elif dev_template_db_status == 'run_migrations':
|
||||
DEV_DATABASE.run_db_migrations()
|
||||
elif dev_template_db_status == 'current':
|
||||
@@ -327,5 +336,10 @@ if __name__ == "__main__":
|
||||
default=False,
|
||||
help="Provision for test suite with production settings.")
|
||||
|
||||
parser.add_argument('--skip-dev-db-build', action='store_true',
|
||||
dest='skip_dev_db_build',
|
||||
default=False,
|
||||
help="Don't run migrations on dev database.")
|
||||
|
||||
options = parser.parse_args()
|
||||
sys.exit(main(options))
|
||||
|
Reference in New Issue
Block a user