From a0e06c3c3e75da17326404dbdc4c38a6aab6b0bf Mon Sep 17 00:00:00 2001 From: Claire Date: Sun, 30 Jan 2022 23:50:08 +0100 Subject: Add more advanced migration tests (#17393) - populate the database with some data when testing migrations - try both one-step and two-step migrations (`SKIP_POST_DEPLOYMENT_MIGRATIONS`) --- .circleci/config.yml | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to '.circleci') diff --git a/.circleci/config.yml b/.circleci/config.yml index e3e4f83d9..751ca95b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -121,9 +121,43 @@ jobs: - run: command: ./bin/rails db:create name: Create database + - run: + command: ./bin/rails db:migrate VERSION=20171010025614 + name: Run migrations up to v2.0.0 + - run: + command: ./bin/rails tests:migrations:populate_v2 + name: Populate database with test data - run: command: ./bin/rails db:migrate - name: Run migrations + name: Run all remaining migrations + + test-two-step-migrations: + executor: + name: default + ruby-version: '3.0' + steps: + - checkout + - install-system-dependencies + - install-ruby-dependencies: + ruby-version: '3.0' + - wait-db + - run: + command: ./bin/rails db:create + name: Create database + - run: + command: ./bin/rails db:migrate VERSION=20171010025614 + name: Run migrations up to v2.0.0 + - run: + command: ./bin/rails tests:migrations:populate_v2 + name: Populate database with test data + - run: + command: ./bin/rails db:migrate + name: Run all pre-deployment migrations + evironment: + SKIP_POST_DEPLOYMENT_MIGRATIONS: true + - run: + command: ./bin/rails db:migrate + name: Run all post-deployment remaining migrations workflows: version: 2 @@ -142,6 +176,9 @@ workflows: - test-migrations: requires: - build + - test-two-step-migrations: + requires: + - build - node/run: cache-version: v1 name: test-webui -- cgit