Commit cf76d567 authored by Nick Thomas's avatar Nick Thomas

Merge branch '208836-run-pg-10-by-default' into 'master'

Run tests against PG10 by default

See merge request gitlab-org/gitlab!28116
parents a3b9bd70 dea33ff4
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"
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
......
......@@ -3,9 +3,9 @@
- .default-retry
- .default-cache
- .default-before_script
- .use-pg9
- .use-pg10
stage: test
needs: ["setup-test-env"]
needs: ["setup-test-env pg10"]
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-pg9-ee
- .use-pg10-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-pg9
- .use-pg10
stage: test
needs: ["setup-test-env"]
needs: ["setup-test-env pg10"]
script:
- bundle exec rake gitlab:graphql:check_docs
- bundle exec rake gitlab:graphql:check_schema
......@@ -135,13 +135,9 @@ compile-assets pull-cache as-if-foss:
- .default-retry
- .default-cache
- .default-before_script
- .use-pg9
- .use-pg10
stage: fixtures
needs:
- job: "setup-test-env"
artifacts: true
- job: "compile-assets pull-cache"
artifacts: true
needs: ["setup-test-env pg10", "compile-assets pull-cache"]
script:
- date
- scripts/gitaly-test-spawn
......@@ -270,7 +266,6 @@ coverage-frontend:
.qa-frontend-node:
extends:
- .default-retry
- .default-cache
- .frontend:rules:qa-frontend-node
stage: test
dependencies: []
......@@ -300,7 +295,7 @@ webpack-dev-server:
- .default-cache
- .frontend:rules:default-frontend-jobs
stage: test
needs: ["setup-test-env", "compile-assets pull-cache"]
needs: ["setup-test-env pg10", "compile-assets pull-cache"]
variables:
WEBPACK_MEMORY_TEST: "true"
WEBPACK_VENDOR_DLL: "true"
......
......@@ -21,7 +21,7 @@
# Jobs that only need to pull cache
.default-cache:
cache:
key: "debian-stretch-ruby-2.6.5-pg9.6-node-12.x"
key: "debian-stretch-ruby-2.6.5-pg10-node-12.x"
paths:
- .go/pkg/mod
- vendor/ruby
......@@ -30,12 +30,15 @@
policy: pull
.use-pg9:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-9.6-graphicsmagick-1.3.34"
services:
- name: postgres:9.6.17
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
variables:
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key: "debian-stretch-ruby-2.6.5-pg9-node-12.x"
.use-pg10:
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"
......@@ -45,6 +48,8 @@
- name: redis:alpine
variables:
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key: "debian-stretch-ruby-2.6.5-pg10-node-12.x"
.use-pg11:
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-11-graphicsmagick-1.3.34"
......@@ -54,8 +59,11 @@
- name: redis:alpine
variables:
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key: "debian-stretch-ruby-2.6.5-pg11-node-12.x"
.use-pg9-ee:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-9.6-graphicsmagick-1.3.34"
services:
- name: postgres:9.6.17
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
......@@ -63,6 +71,8 @@
- name: elasticsearch:6.4.2
variables:
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key: "debian-stretch-ruby-2.6.5-pg9-node-12.x"
.use-pg10-ee:
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"
......@@ -73,6 +83,8 @@
- name: elasticsearch:6.4.2
variables:
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key: "debian-stretch-ruby-2.6.5-pg10-node-12.x"
.use-pg11-ee:
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-11-graphicsmagick-1.3.34"
......@@ -83,6 +95,8 @@
- name: elasticsearch:6.4.2
variables:
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key: "debian-stretch-ruby-2.6.5-pg11-node-12.x"
.as-if-foss:
variables:
......
......@@ -8,9 +8,7 @@
memory-static:
extends: .only-code-memory-job-base
stage: test
needs:
- job: setup-test-env
artifacts: true
needs: ["setup-test-env pg10"]
variables:
SETUP_DB: "false"
script:
......@@ -40,11 +38,7 @@ memory-on-boot:
- .only-code-memory-job-base
- .use-pg10
stage: test
needs:
- job: setup-test-env
artifacts: true
- job: compile-assets pull-cache
artifacts: true
needs: ["setup-test-env pg10", "compile-assets pull-cache"]
variables:
NODE_ENV: "production"
RAILS_ENV: "production"
......
pages:
extends:
- .default-retry
- .default-cache
- .pages:rules
stage: pages
dependencies: ["rspec:coverage", "karma", "gitlab:assets:compile pull-cache"]
......
.rails:needs:setup-and-assets:
needs:
- job: setup-test-env
artifacts: true
- job: compile-assets pull-cache
artifacts: true
needs: ["setup-test-env pg10", "compile-assets pull-cache"]
.rails-job-base:
extends:
......@@ -12,12 +8,10 @@
- .default-before_script
####################
# ee and foss jobs #
setup-test-env:
# EE and FOSS jobs #
.base-setup-test-env:
extends:
- .rails-job-base
- .rails:rules:default-refs-code-backstage-qa
- .use-pg9
stage: prepare
script:
- bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init'
......@@ -31,6 +25,24 @@ setup-test-env:
cache:
policy: pull-push
setup-test-env pg10:
extends:
- .base-setup-test-env
- .rails:rules:default-refs-code-backstage-qa
- .use-pg10
setup-test-env pg11:
extends:
- .base-setup-test-env
- .rails:rules:master-refs-code-backstage
- .use-pg11
setup-test-env pg9:
extends:
- .base-setup-test-env
- .rails:rules:nightly-master-refs-code-backstage
- .use-pg9
static-analysis:
extends:
- .rails-job-base
......@@ -43,7 +55,7 @@ static-analysis:
script:
- scripts/static-analysis
cache:
key: "debian-stretch-ruby-2.6-pg9.6-rubocop"
key: "ruby-2.6.5-pg10-rubocop"
paths:
- vendor/ruby
- tmp/rubocop_cache
......@@ -63,13 +75,7 @@ downtime_check:
.rspec-base:
extends: .rails-job-base
stage: test
needs:
- job: setup-test-env
artifacts: true
- job: retrieve-tests-metadata
artifacts: true
- job: compile-assets pull-cache
artifacts: true
needs: ["setup-test-env pg10", "retrieve-tests-metadata", "compile-assets pull-cache"]
script:
- source scripts/rspec_helpers.sh
- rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag ~level:migration"
......@@ -87,10 +93,10 @@ downtime_check:
reports:
junit: junit_rspec.xml
.rspec-base-quarantine:
.rspec-base-quarantine-pg10:
extends:
- .rspec-base
- .use-pg9
- .use-pg10
variables:
RSPEC_OPTS: "--tag quarantine -- spec/"
script:
......@@ -98,37 +104,37 @@ downtime_check:
- rspec_simple_job "${RSPEC_OPTS}"
allow_failure: true
.rspec-base-pg9:
.rspec-base-pg10:
extends:
- .rspec-base
- .rails:rules:ee-and-foss
- .use-pg9
- .use-pg10
.rspec-base-migration:
script:
- source scripts/rspec_helpers.sh
- rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag level:migration"
rspec migration pg9:
rspec migration pg10:
extends:
- .rspec-base-pg9
- .rspec-base-pg10
- .rspec-base-migration
parallel: 5
rspec unit pg9:
extends: .rspec-base-pg9
rspec unit pg10:
extends: .rspec-base-pg10
parallel: 20
rspec integration pg9:
extends: .rspec-base-pg9
rspec integration pg10:
extends: .rspec-base-pg10
parallel: 8
rspec system pg9:
extends: .rspec-base-pg9
rspec system pg10:
extends: .rspec-base-pg10
parallel: 24
rspec fast_spec_helper:
extends: .rspec-base-pg9
extends: .rspec-base-pg10
script:
- bin/rspec spec/fast_spec_helper.rb
......@@ -136,11 +142,9 @@ rspec fast_spec_helper:
extends:
- .rails-job-base
- .rails:rules:ee-and-foss
- .use-pg9
- .use-pg10
stage: test
needs:
- job: setup-test-env
artifacts: true
needs: ["setup-test-env pg10"]
db:migrate:reset:
extends: .db-job-base
......@@ -209,18 +213,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
- 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
- setup-test-env pg10
- rspec migration pg10
- rspec unit pg10
- rspec integration pg10
- rspec system pg10
- rspec-ee migration pg10
- rspec-ee unit pg10
- rspec-ee integration pg10
- rspec-ee system pg10
- rspec-ee unit pg10 geo
- rspec-ee integration pg10 geo
- rspec-ee system pg10 geo
- memory-static
- memory-on-boot
variables:
......@@ -238,170 +242,167 @@ rspec:coverage:
- coverage/index.html
- coverage/assets/
- tmp/memory_test/
# ee and foss jobs #
# EE and FOSS jobs #
####################
####################
# master-only jobs #
rspec quarantine pg9:
rspec quarantine pg10:
extends:
- .rspec-base-quarantine
- .rspec-base-quarantine-pg10
- .rails:rules:master-refs-code-backstage
.rspec-base-pg10:
.rspec-base-pg11:
extends:
- .rspec-base
- .rails:rules:master-refs-code-backstage
- .use-pg10
- .use-pg11
needs: ["setup-test-env pg11", "retrieve-tests-metadata", "compile-assets pull-cache"]
rspec migration pg10:
rspec migration pg11:
extends:
- .rspec-base-pg10
- .rspec-base-pg11
- .rspec-base-migration
parallel: 2
parallel: 5
rspec unit pg10:
extends: .rspec-base-pg10
rspec unit pg11:
extends: .rspec-base-pg11
parallel: 20
rspec integration pg10:
extends: .rspec-base-pg10
rspec integration pg11:
extends: .rspec-base-pg11
parallel: 8
rspec system pg10:
extends: .rspec-base-pg10
rspec system pg11:
extends: .rspec-base-pg11
parallel: 24
# master-only jobs #
####################
############################
# nightly master-only jobs #
.rspec-base-pg11:
######################
# nightly-only jobs #
.rspec-base-pg9:
extends:
- .rspec-base
- .rails:rules:nightly-master-refs-code-backstage
- .use-pg11
- .use-pg9
needs: ["setup-test-env pg9", "retrieve-tests-metadata", "compile-assets pull-cache"]
rspec migration pg11:
rspec migration pg9:
extends:
- .rspec-base-pg11
- .rspec-base-pg9
- .rspec-base-migration
parallel: 2
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
# nightly master-only jobs #
############################
# nightly-only jobs #
#####################
#########################
# ee + master-only jobs #
rspec-ee quarantine pg9:
#######################
# EE master-only jobs #
rspec-ee quarantine pg10:
extends:
- .rspec-base-quarantine
- .rspec-base-quarantine-pg10
- .rails:rules:master-refs-code-backstage-ee-only
variables:
RSPEC_OPTS: "--tag quarantine -- ee/spec/"
rspec-ee migration pg10:
.rspec-ee-base-pg11:
extends:
- .rspec-ee-base-pg10
- .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-refs-code-backstage
parallel: 2
rspec-ee unit pg10:
rspec-ee unit pg11:
extends:
- .rspec-ee-base-pg10
- .rspec-ee-base-pg11
- .rails:rules:master-refs-code-backstage
parallel: 10
rspec-ee integration pg10:
rspec-ee integration pg11:
extends:
- .rspec-ee-base-pg10
- .rspec-ee-base-pg11
- .rails:rules:master-refs-code-backstage
parallel: 4
rspec-ee system pg10:
rspec-ee system pg11:
extends:
- .rspec-ee-base-pg10
- .rspec-ee-base-pg11
- .rails:rules:master-refs-code-backstage
parallel: 6
# ee + master-only jobs #
#########################
# EE master-only jobs #
#######################
#################
# ee-only jobs #
################
# EE-only jobs #
.rspec-base-ee:
extends:
- .rspec-base
- .rails:rules:ee-only
.rspec-base-pg9-as-if-foss:
.rspec-base-pg10-as-if-foss:
extends:
- .rspec-base-ee
- .as-if-foss
- .use-pg9
needs:
- job: setup-test-env
artifacts: true
- job: retrieve-tests-metadata
artifacts: true
- job: compile-assets pull-cache as-if-foss
artifacts: true
.rspec-ee-base-pg9:
extends:
- .rspec-base-ee
- .use-pg9-ee
- .use-pg10
needs: ["setup-test-env pg10", "retrieve-tests-metadata", "compile-assets pull-cache as-if-foss"]
.rspec-ee-base-pg10:
extends:
- .rspec-base-ee
- .use-pg10-ee
rspec migration pg9-as-if-foss:
rspec migration pg10-as-if-foss:
extends:
- .rspec-base-pg9-as-if-foss
- .rspec-base-pg10-as-if-foss
- .rspec-base-migration
parallel: 5
rspec unit pg9-as-if-foss:
extends: .rspec-base-pg9-as-if-foss
rspec unit pg10-as-if-foss:
extends: .rspec-base-pg10-as-if-foss
parallel: 20
rspec integration pg9-as-if-foss:
extends: .rspec-base-pg9-as-if-foss
rspec integration pg10-as-if-foss:
extends: .rspec-base-pg10-as-if-foss
parallel: 8
rspec system pg9-as-if-foss:
extends: .rspec-base-pg9-as-if-foss
rspec system pg10-as-if-foss:
extends: .rspec-base-pg10-as-if-foss
parallel: 24
rspec-ee migration pg9:
rspec-ee migration pg10:
extends:
- .rspec-ee-base-pg9
- .rspec-ee-base-pg10
- .rspec-base-migration
parallel: 2
rspec-ee unit pg9:
extends: .rspec-ee-base-pg9
rspec-ee unit pg10:
extends: .rspec-ee-base-pg10
parallel: 10
rspec-ee integration pg9:
extends: .rspec-ee-base-pg9
rspec-ee integration pg10:
extends: .rspec-ee-base-pg10
parallel: 4
rspec-ee system pg9:
extends: .rspec-ee-base-pg9
rspec-ee system pg10:
extends: .rspec-ee-base-pg10
parallel: 6
.rspec-ee-base-geo:
......@@ -411,26 +412,11 @@ rspec-ee system pg9:
- scripts/prepare_postgres_fdw.sh
- rspec_paralellized_job "--tag ~quarantine --tag geo"
.rspec-ee-base-geo-pg9:
extends:
- .rspec-ee-base-geo
- .use-pg9-ee
.rspec-ee-base-geo-pg10:
extends:
- .rspec-ee-base-geo
- .use-pg10-ee
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
rspec-ee unit pg10 geo:
extends: .rspec-ee-base-geo-pg10
parallel: 2
......@@ -448,5 +434,26 @@ db:rollback geo:
script:
- bundle exec rake geo:db:migrate VERSION=20170627195211
- bundle exec rake geo:db:migrate
# ee-only jobs #
# EE-only jobs #
################
########################
# EE nightly-only jobs #
.rspec-ee-base-geo-pg9:
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"]
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
# EE nightly-only jobs #
########################
......@@ -361,6 +361,7 @@
- <<: *if-master-refs
changes: *code-backstage-patterns
when: on_success
- changes: [".gitlab/ci/rails.gitlab-ci.yml"]
.rails:rules:master-refs-code-backstage-ee-only:
rules:
......@@ -369,12 +370,23 @@
- <<: *if-master-refs
changes: *code-backstage-patterns
when: on_success
- changes: [".gitlab/ci/rails.gitlab-ci.yml"]
.rails:rules:nightly-master-refs-code-backstage:
rules:
- <<: *if-nightly-master-schedule
changes: *code-backstage-patterns
when: on_success
- changes: [".gitlab/ci/rails.gitlab-ci.yml"]
.rails:rules:nightly-master-refs-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"]
.rails:rules:ee-only:
rules:
......
......@@ -7,9 +7,7 @@ cache gems:
- .default-before_script
- .setup:rules:cache-gems
stage: test
needs:
- job: setup-test-env
artifacts: true
needs: ["setup-test-env pg10"]
variables:
SETUP_DB: "false"
script:
......
......@@ -176,7 +176,7 @@ graph RL;
O[coverage-frontend];
N["pages (master only)"];
Q[package-and-qa];
S["RSpec<br/>(e.g. rspec unit pg9)"]
S["RSpec<br/>(e.g. rspec unit pg10)"]
T[retrieve-tests-metadata];
QA["qa:internal, qa:selectors"];
QA2["qa:internal-as-if-foss, qa:selectors-as-if-foss<br/>(EE default refs only)"];
......
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