Commit ce9229c0 authored by Rémy Coutable's avatar Rémy Coutable

Test against PG9 by default, PG11 in master, and PG10 nightly

Align MR testing strategy with current GitLab.com to ensure
availability for changes of GitLab.com.
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent af527d07
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-10-graphicsmagick-1.3.34"
stages:
- sync
- prepare
......@@ -16,6 +14,7 @@ stages:
# in cases where jobs require Docker-in-Docker, the job
# definition must be extended with `.use-docker-in-docker`
default:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-9.6-graphicsmagick-1.3.34"
tags:
- gitlab-org
# All jobs are interruptible by default
......
......@@ -3,9 +3,9 @@
- .default-retry
- .default-cache
- .default-before_script
- .use-pg11
- .use-pg9
stage: test
needs: ["setup-test-env pg11"]
needs: ["setup-test-env pg9"]
variables:
FIXTURE_PATH: "db/fixtures/development"
SEED_CYCLE_ANALYTICS: "true"
......@@ -26,7 +26,7 @@ run-dev-fixtures-ee:
extends:
- .run-dev-fixtures
- .dev-fixtures:rules:ee-only
- .use-pg11-ee
- .use-pg9-ee
script:
- scripts/gitaly-test-spawn
- cp ee/db/fixtures/development/* $FIXTURE_PATH
......
......@@ -66,9 +66,9 @@ graphql-reference-verify:
- .default-cache
- .default-before_script
- .docs:rules:graphql-reference-verify
- .use-pg11
- .use-pg9
stage: test
needs: ["setup-test-env pg11"]
needs: ["setup-test-env pg9"]
script:
- bundle exec rake gitlab:graphql:check_docs
- bundle exec rake gitlab:graphql:check_schema
......@@ -129,9 +129,9 @@ compile-assets pull-cache as-if-foss:
- .default-retry
- .default-cache
- .default-before_script
- .use-pg11
- .use-pg9
stage: fixtures
needs: ["setup-test-env pg11", "compile-assets pull-cache"]
needs: ["setup-test-env pg9", "compile-assets pull-cache"]
script:
- date
- scripts/gitaly-test-spawn
......
......@@ -8,7 +8,7 @@
memory-static:
extends: .only-code-memory-job-base
stage: test
needs: ["setup-test-env pg11"]
needs: ["setup-test-env pg9"]
variables:
SETUP_DB: "false"
script:
......@@ -36,9 +36,9 @@ memory-static:
memory-on-boot:
extends:
- .only-code-memory-job-base
- .use-pg11
- .use-pg9
stage: test
needs: ["setup-test-env pg11", "compile-assets pull-cache"]
needs: ["setup-test-env pg9", "compile-assets pull-cache"]
variables:
NODE_ENV: "production"
RAILS_ENV: "production"
......
.rails:needs:setup-and-assets:
needs: ["setup-test-env pg11", "compile-assets pull-cache"]
needs: ["setup-test-env pg9", "compile-assets pull-cache"]
.rails-job-base:
extends:
......@@ -7,8 +7,8 @@
- .default-cache
- .default-before_script
####################
# EE and FOSS jobs #
#######################################################
# EE/FOSS: default refs (MRs, master, schedules) jobs #
.base-setup-test-env:
extends:
- .rails-job-base
......@@ -28,19 +28,19 @@
setup-test-env pg11:
extends:
- .base-setup-test-env
- .rails:rules:default-refs-code-backstage-qa
- .rails:rules:master-push--master-schedule-2-hourly--code-backstage
- .use-pg11
setup-test-env pg10:
extends:
- .base-setup-test-env
- .rails:rules:master-refs-code-backstage
- .rails:rules:master-schedule-nightly--code-backstage
- .use-pg10
setup-test-env pg9:
extends:
- .base-setup-test-env
- .rails:rules:nightly-master-refs-code-backstage
- .rails:rules:default-refs-code-backstage-qa
- .use-pg9
static-analysis:
......@@ -55,7 +55,7 @@ static-analysis:
script:
- scripts/static-analysis
cache:
key: "ruby-2.6.5-pg11-rubocop"
key: "ruby-2.6.5-pg9-rubocop"
paths:
- vendor/ruby
- tmp/rubocop_cache
......@@ -75,7 +75,7 @@ downtime_check:
.rspec-base:
extends: .rails-job-base
stage: test
needs: ["setup-test-env pg11", "retrieve-tests-metadata", "compile-assets pull-cache"]
needs: ["setup-test-env pg9", "retrieve-tests-metadata", "compile-assets pull-cache"]
script:
- source scripts/rspec_helpers.sh
- rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag ~level:migration"
......@@ -93,37 +93,37 @@ downtime_check:
reports:
junit: junit_rspec.xml
.rspec-base-pg11:
.rspec-base-pg9:
extends:
- .rspec-base
- .rails:rules:ee-and-foss
- .use-pg11
- .use-pg9
.rspec-base-migration:
script:
- source scripts/rspec_helpers.sh
- rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag level:migration"
rspec migration pg11:
rspec migration pg9:
extends:
- .rspec-base-pg11
- .rspec-base-pg9
- .rspec-base-migration
parallel: 5
rspec unit pg11:
extends: .rspec-base-pg11
rspec unit pg9:
extends: .rspec-base-pg9
parallel: 20
rspec integration pg11:
extends: .rspec-base-pg11
rspec integration pg9:
extends: .rspec-base-pg9
parallel: 8
rspec system pg11:
extends: .rspec-base-pg11
rspec system pg9:
extends: .rspec-base-pg9
parallel: 24
rspec fast_spec_helper:
extends: .rspec-base-pg11
extends: .rspec-base-pg9
script:
- bin/rspec spec/fast_spec_helper.rb
......@@ -131,9 +131,9 @@ rspec fast_spec_helper:
extends:
- .rails-job-base
- .rails:rules:ee-and-foss
- .use-pg11
- .use-pg9
stage: test
needs: ["setup-test-env pg11"]
needs: ["setup-test-env pg9"]
db:migrate:reset:
extends: .db-job-base
......@@ -202,18 +202,18 @@ rspec:coverage:
# We cannot use needs since it would mean needing 84 jobs (since most are parallelized)
# so we use `dependencies` here.
dependencies:
- setup-test-env pg11
- rspec migration pg11
- rspec unit pg11
- rspec integration pg11
- rspec system pg11
- rspec-ee migration pg11
- rspec-ee unit pg11
- rspec-ee integration pg11
- rspec-ee system pg11
- rspec-ee unit pg11 geo
- rspec-ee integration pg11 geo
- rspec-ee system pg11 geo
- setup-test-env pg9
- rspec migration pg9
- rspec unit pg9
- rspec integration pg9
- rspec system pg9
- rspec-ee migration pg9
- rspec-ee unit pg9
- rspec-ee integration pg9
- rspec-ee system pg9
- rspec-ee unit pg9 geo
- rspec-ee integration pg9 geo
- rspec-ee system pg9 geo
- memory-static
- memory-on-boot
variables:
......@@ -231,206 +231,206 @@ rspec:coverage:
- coverage/index.html
- coverage/assets/
- tmp/memory_test/
# EE and FOSS jobs #
####################
# EE/FOSS: default refs (MRs, master, schedules) jobs #
#######################################################
####################
# master-only jobs #
.rspec-base-pg10:
##################################################
# EE: default refs (MRs, master, schedules) jobs #
.rspec-base-ee:
extends:
- .rspec-base
- .rails:rules:master-refs-code-backstage
- .use-pg10
needs: ["setup-test-env pg10", "retrieve-tests-metadata", "compile-assets pull-cache"]
- .rails:rules:ee-only
rspec migration pg10:
.rspec-base-pg9-as-if-foss:
extends:
- .rspec-base-pg10
- .rspec-base-migration
parallel: 5
rspec unit pg10:
extends: .rspec-base-pg10
parallel: 20
rspec integration pg10:
extends: .rspec-base-pg10
parallel: 8
rspec system pg10:
extends: .rspec-base-pg10
parallel: 24
# master-only jobs #
####################
- .rspec-base-ee
- .as-if-foss
- .use-pg9
needs: ["setup-test-env pg9", "retrieve-tests-metadata", "compile-assets pull-cache as-if-foss"]
######################
# nightly-only jobs #
.rspec-base-pg9:
.rspec-ee-base-pg9:
extends:
- .rspec-base
- .rails:rules:nightly-master-refs-code-backstage
- .use-pg9
needs: ["setup-test-env pg9", "retrieve-tests-metadata", "compile-assets pull-cache"]
- .rspec-base-ee
- .use-pg9-ee
rspec migration pg9:
rspec migration pg9-as-if-foss:
extends:
- .rspec-base-pg9
- .rspec-base-pg9-as-if-foss
- .rspec-base-migration
parallel: 5
rspec unit pg9:
extends: .rspec-base-pg9
rspec unit pg9-as-if-foss:
extends: .rspec-base-pg9-as-if-foss
parallel: 20
rspec integration pg9:
extends: .rspec-base-pg9
rspec integration pg9-as-if-foss:
extends: .rspec-base-pg9-as-if-foss
parallel: 8
rspec system pg9:
extends: .rspec-base-pg9
rspec system pg9-as-if-foss:
extends: .rspec-base-pg9-as-if-foss
parallel: 24
# nightly-only jobs #
#####################
#######################
# EE master-only jobs #
.rspec-ee-base-pg10:
rspec-ee migration pg9:
extends:
- .rspec-base-ee
- .use-pg10-ee
needs: ["setup-test-env pg10", "retrieve-tests-metadata", "compile-assets pull-cache"]
rspec-ee migration pg10:
extends:
- .rspec-ee-base-pg10
- .rspec-ee-base-pg9
- .rspec-base-migration
- .rails:rules:master-refs-code-backstage
parallel: 2
rspec-ee unit pg10:
extends:
- .rspec-ee-base-pg10
- .rails:rules:master-refs-code-backstage
rspec-ee unit pg9:
extends: .rspec-ee-base-pg9
parallel: 10
rspec-ee integration pg10:
extends:
- .rspec-ee-base-pg10
- .rails:rules:master-refs-code-backstage
rspec-ee integration pg9:
extends: .rspec-ee-base-pg9
parallel: 4
rspec-ee system pg10:
extends:
- .rspec-ee-base-pg10
- .rails:rules:master-refs-code-backstage
rspec-ee system pg9:
extends: .rspec-ee-base-pg9
parallel: 6
# EE master-only jobs #
#######################
################
# EE-only jobs #
.rspec-base-ee:
.rspec-ee-base-geo:
extends: .rspec-base-ee
script:
- source scripts/rspec_helpers.sh
- scripts/prepare_postgres_fdw.sh
- rspec_paralellized_job "--tag ~quarantine --tag geo"
.rspec-ee-base-geo-pg9:
extends:
- .rspec-base
- .rails:rules:ee-only
- .rspec-ee-base-geo
- .use-pg9-ee
.rspec-base-pg11-as-if-foss:
rspec-ee unit pg9 geo:
extends: .rspec-ee-base-geo-pg9
parallel: 2
rspec-ee integration pg9 geo:
extends: .rspec-ee-base-geo-pg9
rspec-ee system pg9 geo:
extends: .rspec-ee-base-geo-pg9
db:rollback geo:
extends:
- .rspec-base-ee
- .as-if-foss
- .use-pg11
needs: ["setup-test-env pg11", "retrieve-tests-metadata", "compile-assets pull-cache as-if-foss"]
- db:rollback
- .rails:rules:ee-only
script:
- bundle exec rake geo:db:migrate VERSION=20170627195211
- bundle exec rake geo:db:migrate
# EE: default refs (MRs, master, schedules) jobs #
##################################################
.rspec-ee-base-pg11:
####################################################################
# EE/FOSS: master non-scheduled and master 2-hourly scheduled jobs #
.rspec-base-pg11:
extends:
- .rspec-base-ee
- .use-pg11-ee
- .rspec-base
- .rails:rules:master-push--master-schedule-2-hourly--code-backstage
- .use-pg11
needs: ["setup-test-env pg11", "retrieve-tests-metadata", "compile-assets pull-cache"]
rspec migration pg11-as-if-foss:
rspec migration pg11:
extends:
- .rspec-base-pg11-as-if-foss
- .rspec-base-pg11
- .rspec-base-migration
parallel: 5
rspec unit pg11-as-if-foss:
extends: .rspec-base-pg11-as-if-foss
rspec unit pg11:
extends: .rspec-base-pg11
parallel: 20
rspec integration pg11-as-if-foss:
extends: .rspec-base-pg11-as-if-foss
rspec integration pg11:
extends: .rspec-base-pg11
parallel: 8
rspec system pg11-as-if-foss:
extends: .rspec-base-pg11-as-if-foss
rspec system pg11:
extends: .rspec-base-pg11
parallel: 24
# EE/FOSS: master non-scheduled and master 2-hourly scheduled jobs #
####################################################################
###############################################################
# EE: master non-scheduled and master 2-hourly scheduled jobs #
.rspec-ee-base-pg11:
extends:
- .rspec-base-ee
- .use-pg11-ee
needs: ["setup-test-env pg11", "retrieve-tests-metadata", "compile-assets pull-cache"]
rspec-ee migration pg11:
extends:
- .rspec-ee-base-pg11
- .rspec-base-migration
- .rails:rules:master-push--master-schedule-2-hourly--code-backstage
parallel: 2
rspec-ee unit pg11:
extends: .rspec-ee-base-pg11
extends:
- .rspec-ee-base-pg11
- .rails:rules:master-push--master-schedule-2-hourly--code-backstage
parallel: 10
rspec-ee integration pg11:
extends: .rspec-ee-base-pg11
extends:
- .rspec-ee-base-pg11
- .rails:rules:master-push--master-schedule-2-hourly--code-backstage
parallel: 4
rspec-ee system pg11:
extends: .rspec-ee-base-pg11
extends:
- .rspec-ee-base-pg11
- .rails:rules:master-push--master-schedule-2-hourly--code-backstage
parallel: 6
# EE: master non-scheduled and master 2-hourly scheduled jobs #
###############################################################
.rspec-ee-base-geo:
extends: .rspec-base-ee
script:
- source scripts/rspec_helpers.sh
- scripts/prepare_postgres_fdw.sh
- rspec_paralellized_job "--tag ~quarantine --tag geo"
.rspec-ee-base-geo-pg11:
##########################################
# EE/FOSS: master nightly scheduled jobs #
.rspec-base-pg10:
extends:
- .rspec-ee-base-geo
- .use-pg11-ee
- .rspec-base
- .rails:rules:master-schedule-nightly--code-backstage
- .use-pg10
needs: ["setup-test-env pg10", "retrieve-tests-metadata", "compile-assets pull-cache"]
rspec-ee unit pg11 geo:
extends: .rspec-ee-base-geo-pg11
parallel: 2
rspec migration pg10:
extends:
- .rspec-base-pg10
- .rspec-base-migration
parallel: 5
rspec-ee integration pg11 geo:
extends: .rspec-ee-base-geo-pg11
rspec unit pg10:
extends: .rspec-base-pg10
parallel: 20
rspec-ee system pg11 geo:
extends: .rspec-ee-base-geo-pg11
rspec integration pg10:
extends: .rspec-base-pg10
parallel: 8
db:rollback geo:
extends:
- db:rollback
- .rails:rules:ee-only
script:
- bundle exec rake geo:db:migrate VERSION=20170627195211
- bundle exec rake geo:db:migrate
# EE-only jobs #
################
rspec system pg10:
extends: .rspec-base-pg10
parallel: 24
# EE/FOSS: master nightly scheduled jobs #
##########################################
########################
# EE nightly-only jobs #
.rspec-ee-base-geo-pg9:
##############################
# EE: nightly scheduled jobs #
.rspec-ee-base-geo-pg10:
extends:
- .rspec-ee-base-geo
- .use-pg9-ee
- .rails:rules:nightly-master-refs-code-backstage-ee-only
needs: ["setup-test-env pg9", "retrieve-tests-metadata", "compile-assets pull-cache"]
- .use-pg10-ee
- .rails:rules:master-schedule-nightly--code-backstage-ee-only
needs: ["setup-test-env pg10", "retrieve-tests-metadata", "compile-assets pull-cache"]
rspec-ee unit pg9 geo:
extends: .rspec-ee-base-geo-pg9
rspec-ee unit pg10 geo:
extends: .rspec-ee-base-geo-pg10
parallel: 2
rspec-ee integration pg9 geo:
extends: .rspec-ee-base-geo-pg9
rspec-ee integration pg10 geo:
extends: .rspec-ee-base-geo-pg10
rspec-ee system pg9 geo:
extends: .rspec-ee-base-geo-pg9
# EE nightly-only jobs #
########################
rspec-ee system pg10 geo:
extends: .rspec-ee-base-geo-pg10
# EE: nightly scheduled jobs #
##############################
......@@ -16,6 +16,15 @@
.if-master-refs: &if-master-refs
if: '$CI_COMMIT_REF_NAME == "master"'
.if-master-push: &if-master-push
if: '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE == "push"'
.if-master-schedule-2-hourly: &if-master-schedule-2-hourly
if: '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "2-hourly"'
.if-master-schedule-nightly: &if-master-schedule-nightly
if: '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "nightly"'
.if-auto-deploy-branches: &if-auto-deploy-branches
if: '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/'
......@@ -25,9 +34,6 @@
.if-merge-request: &if-merge-request
if: '$CI_MERGE_REQUEST_IID'
.if-nightly-master-schedule: &if-nightly-master-schedule
if: '$NIGHTLY && $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule"'
.if-dot-com-gitlab-org-schedule: &if-dot-com-gitlab-org-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_PIPELINE_SOURCE == "schedule"'
......@@ -348,36 +354,33 @@
rules:
- <<: *if-default-refs
changes: *code-backstage-patterns
when: on_success
.rails:rules:default-refs-code-backstage-qa:
rules:
- <<: *if-default-refs
changes: *code-backstage-qa-patterns
when: on_success
.rails:rules:master-refs-code-backstage:
.rails:rules:master-push--master-schedule-2-hourly--code-backstage:
rules:
- <<: *if-master-refs
- <<: *if-master-push
changes: *code-backstage-patterns
when: on_success
- changes: [".gitlab/ci/rails.gitlab-ci.yml"]
- <<: *if-master-schedule-2-hourly
- <<: *if-merge-request
changes: [".gitlab/ci/rails.gitlab-ci.yml"]
.rails:rules:nightly-master-refs-code-backstage:
.rails:rules:master-schedule-nightly--code-backstage:
rules:
- <<: *if-nightly-master-schedule
changes: *code-backstage-patterns
when: on_success
- changes: [".gitlab/ci/rails.gitlab-ci.yml"]
- <<: *if-master-schedule-nightly
- <<: *if-merge-request
changes: [".gitlab/ci/rails.gitlab-ci.yml"]
.rails:rules:nightly-master-refs-code-backstage-ee-only:
.rails:rules:master-schedule-nightly--code-backstage-ee-only:
rules:
- <<: *if-not-ee
when: never
- <<: *if-nightly-master-schedule
changes: *code-backstage-patterns
when: on_success
- changes: [".gitlab/ci/rails.gitlab-ci.yml"]
- <<: *if-master-schedule-nightly
- <<: *if-merge-request
changes: [".gitlab/ci/rails.gitlab-ci.yml"]
.rails:rules:ee-only:
rules:
......@@ -385,13 +388,11 @@
when: never
- <<: *if-default-refs
changes: *code-backstage-patterns
when: on_success
.rails:rules:downtime_check:
rules:
- <<: *if-merge-request
changes: *code-backstage-patterns
when: on_success
##################
# Releases rules #
......
......@@ -7,7 +7,7 @@ cache gems:
- .default-before_script
- .setup:rules:cache-gems
stage: test
needs: ["setup-test-env pg11"]
needs: ["setup-test-env pg9"]
variables:
SETUP_DB: "false"
script:
......
......@@ -32,18 +32,18 @@ update-tests-metadata:
- .test-metadata:rules:update-tests-metadata
stage: post-test
dependencies:
- setup-test-env pg11
- rspec migration pg11
- rspec unit pg11
- rspec integration pg11
- rspec system pg11
- rspec-ee migration pg11
- rspec-ee unit pg11
- rspec-ee integration pg11
- rspec-ee system pg11
- rspec-ee unit pg11 geo
- rspec-ee integration pg11 geo
- rspec-ee system pg11 geo
- setup-test-env pg9
- rspec migration pg9
- rspec unit pg9
- rspec integration pg9
- rspec system pg9
- rspec-ee migration pg9
- rspec-ee unit pg9
- rspec-ee integration pg9
- rspec-ee system pg9
- rspec-ee unit pg9 geo
- rspec-ee integration pg9 geo
- rspec-ee system pg9 geo
cache:
policy: push
script:
......
......@@ -151,15 +151,26 @@ request, be sure to start the `dont-interrupt-me` job before pushing.
## PostgreSQL versions testing
### Current versions testing
| Where? | PG version |
| ------ | ------ |
| MRs | 9.6 |
| `master` (non-scheduled pipelines) | 9.6 / 11 |
| 2-hourly scheduled pipelines | 9.6 / 11 |
| Nightly scheduled pipeline | 9.6 / 10 |
### Long-term plan
We follow the [PostgreSQL versions shipped with Omnibus GitLab](https://docs.gitlab.com/omnibus/package-information/postgresql_versions.html):
| | 12.10 (April 2020) | 13.0 (May 2020) | 13.1 (June 2020) | 13.2 (July 2020) | 13.3 (August 2020) | 13.4, 13.5 | 13.6 (November 2020) | 14.0 (May 2021?) |
| PG version | 12.10 (April 2020) | 13.0 (May 2020) | 13.1 (June 2020) | 13.2 (July 2020) | 13.3 (August 2020) | 13.4, 13.5 | 13.6 (November 2020) | 14.0 (May 2021?) |
| ------ | ------------------ | --------------- | ---------------- | ---------------- | ------------------ | ------------ | -------------------- | ---------------- |
| PG9.6 | nightly | - | - | - | - | - | - | - |
| PG10 | `master` | - | - | - | - | - | - | - |
| PG11 | MRs/`master` | MRs/`master` | MRs/`master` | MRs/`master` | MRs/`master` | MRs/`master` | nightly | - |
| PG12 | - | - | - | - | `master` | `master` | MRs/`master` | `master` |
| PG13 | - | - | - | - | - | - | - | MRs/`master` |
| PG9.6 | MRs/`master`/`2-hour`/`nightly` | - | - | - | - | - | - | - |
| PG10 | `nightly` | - | - | - | - | - | - | - |
| PG11 | `master`/`2-hour` | MRs/`master`/`2-hour`/`nightly` | MRs/`master`/`2-hour`/`nightly` | MRs/`master`/`2-hour`/`nightly` | MRs/`master`/`2-hour`/`nightly` | MRs/`master`/`2-hour`/`nightly` | `nightly` | - |
| PG12 | - | - | - | - | `master`/`2-hour` | `master`/`2-hour` | MRs/`master`/`2-hour`/`nightly` | `master`/`2-hour` |
| PG13 | - | - | - | - | - | - | - | MRs/`master`/`2-hour`/`nightly` |
## Pipeline types
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment