Commit 7c61599f authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch '215053-tests-against-pg9' into 'master'

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

Closes #215053

See merge request gitlab-org/gitlab!30293
parents d41db64a ce9229c0
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: stages:
- sync - sync
- prepare - prepare
...@@ -16,6 +14,7 @@ stages: ...@@ -16,6 +14,7 @@ stages:
# in cases where jobs require Docker-in-Docker, the job # in cases where jobs require Docker-in-Docker, the job
# definition must be extended with `.use-docker-in-docker` # definition must be extended with `.use-docker-in-docker`
default: 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: tags:
- gitlab-org - gitlab-org
# All jobs are interruptible by default # All jobs are interruptible by default
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
- .default-retry - .default-retry
- .default-cache - .default-cache
- .default-before_script - .default-before_script
- .use-pg11 - .use-pg9
stage: test stage: test
needs: ["setup-test-env pg11"] needs: ["setup-test-env pg9"]
variables: variables:
FIXTURE_PATH: "db/fixtures/development" FIXTURE_PATH: "db/fixtures/development"
SEED_CYCLE_ANALYTICS: "true" SEED_CYCLE_ANALYTICS: "true"
...@@ -26,7 +26,7 @@ run-dev-fixtures-ee: ...@@ -26,7 +26,7 @@ run-dev-fixtures-ee:
extends: extends:
- .run-dev-fixtures - .run-dev-fixtures
- .dev-fixtures:rules:ee-only - .dev-fixtures:rules:ee-only
- .use-pg11-ee - .use-pg9-ee
script: script:
- scripts/gitaly-test-spawn - scripts/gitaly-test-spawn
- cp ee/db/fixtures/development/* $FIXTURE_PATH - cp ee/db/fixtures/development/* $FIXTURE_PATH
......
...@@ -66,9 +66,9 @@ graphql-reference-verify: ...@@ -66,9 +66,9 @@ graphql-reference-verify:
- .default-cache - .default-cache
- .default-before_script - .default-before_script
- .docs:rules:graphql-reference-verify - .docs:rules:graphql-reference-verify
- .use-pg11 - .use-pg9
stage: test stage: test
needs: ["setup-test-env pg11"] needs: ["setup-test-env pg9"]
script: script:
- bundle exec rake gitlab:graphql:check_docs - bundle exec rake gitlab:graphql:check_docs
- bundle exec rake gitlab:graphql:check_schema - bundle exec rake gitlab:graphql:check_schema
...@@ -129,9 +129,9 @@ compile-assets pull-cache as-if-foss: ...@@ -129,9 +129,9 @@ compile-assets pull-cache as-if-foss:
- .default-retry - .default-retry
- .default-cache - .default-cache
- .default-before_script - .default-before_script
- .use-pg11 - .use-pg9
stage: fixtures stage: fixtures
needs: ["setup-test-env pg11", "compile-assets pull-cache"] needs: ["setup-test-env pg9", "compile-assets pull-cache"]
script: script:
- date - date
- scripts/gitaly-test-spawn - scripts/gitaly-test-spawn
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
memory-static: memory-static:
extends: .only-code-memory-job-base extends: .only-code-memory-job-base
stage: test stage: test
needs: ["setup-test-env pg11"] needs: ["setup-test-env pg9"]
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
script: script:
...@@ -36,9 +36,9 @@ memory-static: ...@@ -36,9 +36,9 @@ memory-static:
memory-on-boot: memory-on-boot:
extends: extends:
- .only-code-memory-job-base - .only-code-memory-job-base
- .use-pg11 - .use-pg9
stage: test stage: test
needs: ["setup-test-env pg11", "compile-assets pull-cache"] needs: ["setup-test-env pg9", "compile-assets pull-cache"]
variables: variables:
NODE_ENV: "production" NODE_ENV: "production"
RAILS_ENV: "production" RAILS_ENV: "production"
......
This diff is collapsed.
...@@ -16,6 +16,15 @@ ...@@ -16,6 +16,15 @@
.if-master-refs: &if-master-refs .if-master-refs: &if-master-refs
if: '$CI_COMMIT_REF_NAME == "master"' 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-auto-deploy-branches: &if-auto-deploy-branches
if: '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/' if: '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/'
...@@ -25,9 +34,6 @@ ...@@ -25,9 +34,6 @@
.if-merge-request: &if-merge-request .if-merge-request: &if-merge-request
if: '$CI_MERGE_REQUEST_IID' 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-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"' if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_PIPELINE_SOURCE == "schedule"'
...@@ -360,36 +366,33 @@ ...@@ -360,36 +366,33 @@
rules: rules:
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-patterns changes: *code-backstage-patterns
when: on_success
.rails:rules:default-refs-code-backstage-qa: .rails:rules:default-refs-code-backstage-qa:
rules: rules:
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-qa-patterns 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: rules:
- <<: *if-master-refs - <<: *if-master-push
changes: *code-backstage-patterns changes: *code-backstage-patterns
when: on_success - <<: *if-master-schedule-2-hourly
- changes: [".gitlab/ci/rails.gitlab-ci.yml"] - <<: *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: rules:
- <<: *if-nightly-master-schedule - <<: *if-master-schedule-nightly
changes: *code-backstage-patterns - <<: *if-merge-request
when: on_success changes: [".gitlab/ci/rails.gitlab-ci.yml"]
- 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: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-nightly-master-schedule - <<: *if-master-schedule-nightly
changes: *code-backstage-patterns - <<: *if-merge-request
when: on_success changes: [".gitlab/ci/rails.gitlab-ci.yml"]
- changes: [".gitlab/ci/rails.gitlab-ci.yml"]
.rails:rules:ee-only: .rails:rules:ee-only:
rules: rules:
...@@ -397,7 +400,6 @@ ...@@ -397,7 +400,6 @@
when: never when: never
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-patterns changes: *code-backstage-patterns
when: on_success
.rails:rules:ee-mr-and-master-only: .rails:rules:ee-mr-and-master-only:
rules: rules:
...@@ -412,7 +414,6 @@ ...@@ -412,7 +414,6 @@
rules: rules:
- <<: *if-merge-request - <<: *if-merge-request
changes: *code-backstage-patterns changes: *code-backstage-patterns
when: on_success
################## ##################
# Releases rules # # Releases rules #
......
...@@ -7,7 +7,7 @@ cache gems: ...@@ -7,7 +7,7 @@ cache gems:
- .default-before_script - .default-before_script
- .setup:rules:cache-gems - .setup:rules:cache-gems
stage: test stage: test
needs: ["setup-test-env pg11"] needs: ["setup-test-env pg9"]
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
script: script:
......
...@@ -32,18 +32,18 @@ update-tests-metadata: ...@@ -32,18 +32,18 @@ update-tests-metadata:
- .test-metadata:rules:update-tests-metadata - .test-metadata:rules:update-tests-metadata
stage: post-test stage: post-test
dependencies: dependencies:
- setup-test-env pg11 - setup-test-env pg9
- rspec migration pg11 - rspec migration pg9
- rspec unit pg11 - rspec unit pg9
- rspec integration pg11 - rspec integration pg9
- rspec system pg11 - rspec system pg9
- rspec-ee migration pg11 - rspec-ee migration pg9
- rspec-ee unit pg11 - rspec-ee unit pg9
- rspec-ee integration pg11 - rspec-ee integration pg9
- rspec-ee system pg11 - rspec-ee system pg9
- rspec-ee unit pg11 geo - rspec-ee unit pg9 geo
- rspec-ee integration pg11 geo - rspec-ee integration pg9 geo
- rspec-ee system pg11 geo - rspec-ee system pg9 geo
cache: cache:
policy: push policy: push
script: script:
......
...@@ -151,15 +151,26 @@ request, be sure to start the `dont-interrupt-me` job before pushing. ...@@ -151,15 +151,26 @@ request, be sure to start the `dont-interrupt-me` job before pushing.
## PostgreSQL versions testing ## 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): 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 | - | - | - | - | - | - | - | | PG9.6 | MRs/`master`/`2-hour`/`nightly` | - | - | - | - | - | - | - |
| PG10 | `master` | - | - | - | - | - | - | - | | PG10 | `nightly` | - | - | - | - | - | - | - |
| PG11 | MRs/`master` | MRs/`master` | MRs/`master` | MRs/`master` | MRs/`master` | MRs/`master` | 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` | `master` | MRs/`master` | `master` | | PG12 | - | - | - | - | `master`/`2-hour` | `master`/`2-hour` | MRs/`master`/`2-hour`/`nightly` | `master`/`2-hour` |
| PG13 | - | - | - | - | - | - | - | MRs/`master` | | PG13 | - | - | - | - | - | - | - | MRs/`master`/`2-hour`/`nightly` |
## Pipeline types ## 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