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

ci: Test low-level DB code against PG12

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 4d67e117
......@@ -300,6 +300,16 @@ rspec system pg11 minimal:
- .minimal-rspec-tests
- .rails:rules:ee-and-foss-system:minimal
# Dedicated job to test DB library code against PG12.
# Note that these are already tested against PG11 in the `rspec unit pg11` / `rspec-ee unit pg11` jobs.
rspec db-library-code pg12:
extends:
- .rspec-base-pg12
- .rails:rules:ee-and-foss-db-library-code
script:
- *base-script
- rspec_simple_job "-- spec/lib/gitlab/database/ spec/support/helpers/database/ ee/spec/lib/gitlab/database/ ee/spec/lib/ee/gitlab/database_spec.rb"
rspec fast_spec_helper:
extends:
- .rspec-base-pg11
......
......@@ -155,9 +155,15 @@
- "{,ee/}{,spec/}lib/{,ee/}gitlab/database{,_spec}.rb"
- "{,ee/}{,spec/}lib/{,ee/}gitlab/background_migration/**/*"
- "{,ee/}{,spec/}lib/{,ee/}gitlab/background_migration{,_spec}.rb"
- "{,ee/}spec/support/helpers/database/**/*"
- "config/prometheus/common_metrics.yml" # Used by Gitlab::DatabaseImporters::CommonMetrics::Importer
- "{,ee/}app/models/project_statistics.rb" # Used to calculate sizes in migration specs
.db-library-patterns: &db-library-patterns
- "{,ee/}{,spec/}lib/{,ee/}gitlab/database/**/*"
- "{,ee/}{,spec/}lib/{,ee/}gitlab/database{,_spec}.rb"
- "{,ee/}spec/support/helpers/database/**/*"
.backstage-patterns: &backstage-patterns
- "Dangerfile"
- "danger/**/*"
......@@ -775,6 +781,11 @@
- <<: *if-merge-request-title-as-if-foss
changes: *code-backstage-patterns
.rails:rules:ee-and-foss-db-library-code:
rules:
- changes: *db-library-patterns
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:ee-mr-and-master-only:
rules:
- <<: *if-not-ee
......
......@@ -422,24 +422,29 @@ We are using a custom mapping between source file to test files, maintained in t
### PostgreSQL versions testing
Even though [Omnibus defaults to PG12 for new installs and upgrades](https://docs.gitlab.com/omnibus/package-information/postgresql_versions.md),
our test suite is currently running against PG11, since GitLab.com still runs on PG11.
We do run our test suite against PG12 on nightly scheduled pipelines as well as upon specific
database library changes in MRs and `master` pipelines (with the `rspec db-library-code pg12` job).
#### Current versions testing
| Where? | PostgreSQL version |
| ------ | ------ |
| MRs | 11 |
| `master` (non-scheduled pipelines) | 11 |
| 2-hourly scheduled pipelines | 11 |
| ------ | ------------------ |
| MRs | 11, 12 for DB library changes |
| `master` (non-scheduled pipelines) | 11, 12 for DB library changes |
| 2-hourly scheduled pipelines | 11, 12 for DB library changes |
| `nightly` scheduled pipelines | 11, 12 |
#### Long-term plan
We follow the [PostgreSQL versions shipped with Omnibus GitLab](https://docs.gitlab.com/omnibus/package-information/postgresql_versions.html):
| PostgreSQL version | 13.0 (May 2020) | 13.1 (June 2020) | 13.2 (July 2020) | 13.3 (August 2020) | 13.4, 13.5 | [13.7 (December 2020)](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/5722) | 14.0 (May 2021?) |
| ------ | --------------- | ---------------- | ---------------- | ------------------ | ------------ | -------------------- | ---------------- |
| PG11 | 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 | - | - | `nightly` | `2-hour`/`nightly` | `2-hour`/`nightly` | MRs/`2-hour`/`nightly` | `2-hour`/`nightly` |
| PG13 | - | - | - | - | - | - | MRs/`2-hour`/`nightly` |
| PostgreSQL version | 13.7 (December 2020) | 13.8 (January 2021) | 13.9 (February 2021) | 13.10 (March 2021) | 13.11 (April 2021) | 14.0 (May 2021?) |
| -------------------| -------------------- | ------------------- | -------------------- | ------------------ | ------------------ | ---------------- |
| PG11 | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` |
| PG12 | `nightly` | `nightly` | `nightly` | `nightly` | `nightly` | `nightly` |
### Test jobs
......
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