Commit dc3c0e6c authored by Albert Salim's avatar Albert Salim

Merge branch 'decomposed_db_scripts_for_ci_tests' into 'master'

New RSpec jobs in decomposed database mode

See merge request gitlab-org/gitlab!68232
parents b397f81c 1ae2185f
...@@ -23,6 +23,10 @@ ...@@ -23,6 +23,10 @@
variables: variables:
RSPEC_TESTS_MAPPING_ENABLED: "true" RSPEC_TESTS_MAPPING_ENABLED: "true"
.decomposed-database-rspec:
variables:
DECOMPOSED_DB: "true"
.rspec-base: .rspec-base:
extends: .rails-job-base extends: .rails-job-base
stage: test stage: test
...@@ -296,6 +300,12 @@ rspec migration pg12 minimal: ...@@ -296,6 +300,12 @@ rspec migration pg12 minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:ee-and-foss-migration:minimal - .rails:rules:ee-and-foss-migration:minimal
rspec migration pg12 decomposed:
extends:
- rspec migration pg12
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec unit pg12: rspec unit pg12:
extends: extends:
- .rspec-base-pg12 - .rspec-base-pg12
...@@ -308,6 +318,12 @@ rspec unit pg12 minimal: ...@@ -308,6 +318,12 @@ rspec unit pg12 minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:ee-and-foss-unit:minimal - .rails:rules:ee-and-foss-unit:minimal
rspec unit pg12 decomposed:
extends:
- rspec unit pg12
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec integration pg12: rspec integration pg12:
extends: extends:
- .rspec-base-pg12 - .rspec-base-pg12
...@@ -320,6 +336,12 @@ rspec integration pg12 minimal: ...@@ -320,6 +336,12 @@ rspec integration pg12 minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:ee-and-foss-integration:minimal - .rails:rules:ee-and-foss-integration:minimal
rspec integration pg12 decomposed:
extends:
- rspec integration pg12
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec system pg12: rspec system pg12:
extends: extends:
- .rspec-base-pg12 - .rspec-base-pg12
...@@ -332,6 +354,12 @@ rspec system pg12 minimal: ...@@ -332,6 +354,12 @@ rspec system pg12 minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:ee-and-foss-system:minimal - .rails:rules:ee-and-foss-system:minimal
rspec system pg12 decomposed:
extends:
- rspec system pg12
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
# Dedicated job to test DB library code against PG11. # Dedicated job to test DB library code against PG11.
# Note that these are already tested against PG12 in the `rspec unit pg12` / `rspec-ee unit pg12` jobs. # Note that these are already tested against PG12 in the `rspec unit pg12` / `rspec-ee unit pg12` jobs.
rspec db-library-code pg11: rspec db-library-code pg11:
...@@ -554,6 +582,12 @@ rspec migration pg12-as-if-foss minimal: ...@@ -554,6 +582,12 @@ rspec migration pg12-as-if-foss minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:as-if-foss-migration:minimal - .rails:rules:as-if-foss-migration:minimal
rspec migration pg12-as-if-foss decomposed:
extends:
- rspec migration pg12-as-if-foss
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec unit pg12-as-if-foss: rspec unit pg12-as-if-foss:
extends: extends:
- .rspec-base-pg12-as-if-foss - .rspec-base-pg12-as-if-foss
...@@ -566,6 +600,12 @@ rspec unit pg12-as-if-foss minimal: ...@@ -566,6 +600,12 @@ rspec unit pg12-as-if-foss minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:as-if-foss-unit:minimal - .rails:rules:as-if-foss-unit:minimal
rspec unit pg12-as-if-foss decomposed:
extends:
- rspec unit pg12-as-if-foss
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec integration pg12-as-if-foss: rspec integration pg12-as-if-foss:
extends: extends:
- .rspec-base-pg12-as-if-foss - .rspec-base-pg12-as-if-foss
...@@ -578,6 +618,12 @@ rspec integration pg12-as-if-foss minimal: ...@@ -578,6 +618,12 @@ rspec integration pg12-as-if-foss minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:as-if-foss-integration:minimal - .rails:rules:as-if-foss-integration:minimal
rspec integration pg12-as-if-foss decomposed:
extends:
- rspec integration pg12-as-if-foss
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec system pg12-as-if-foss: rspec system pg12-as-if-foss:
extends: extends:
- .rspec-base-pg12-as-if-foss - .rspec-base-pg12-as-if-foss
...@@ -590,6 +636,12 @@ rspec system pg12-as-if-foss minimal: ...@@ -590,6 +636,12 @@ rspec system pg12-as-if-foss minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:as-if-foss-system:minimal - .rails:rules:as-if-foss-system:minimal
rspec system pg12-as-if-foss decomposed:
extends:
- rspec system pg12-as-if-foss
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec-ee migration pg12: rspec-ee migration pg12:
extends: extends:
- .rspec-ee-base-pg12 - .rspec-ee-base-pg12
...@@ -603,6 +655,12 @@ rspec-ee migration pg12 minimal: ...@@ -603,6 +655,12 @@ rspec-ee migration pg12 minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:ee-only-migration:minimal - .rails:rules:ee-only-migration:minimal
rspec-ee migration pg12 decomposed:
extends:
- rspec-ee migration pg12
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec-ee unit pg12: rspec-ee unit pg12:
extends: extends:
- .rspec-ee-base-pg12 - .rspec-ee-base-pg12
...@@ -615,6 +673,12 @@ rspec-ee unit pg12 minimal: ...@@ -615,6 +673,12 @@ rspec-ee unit pg12 minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:ee-only-unit:minimal - .rails:rules:ee-only-unit:minimal
rspec-ee unit pg12 decomposed:
extends:
- rspec-ee unit pg12
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec-ee integration pg12: rspec-ee integration pg12:
extends: extends:
- .rspec-ee-base-pg12 - .rspec-ee-base-pg12
...@@ -627,6 +691,12 @@ rspec-ee integration pg12 minimal: ...@@ -627,6 +691,12 @@ rspec-ee integration pg12 minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:ee-only-integration:minimal - .rails:rules:ee-only-integration:minimal
rspec-ee integration pg12 decomposed:
extends:
- rspec-ee integration pg12
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec-ee system pg12: rspec-ee system pg12:
extends: extends:
- .rspec-ee-base-pg12 - .rspec-ee-base-pg12
...@@ -639,6 +709,12 @@ rspec-ee system pg12 minimal: ...@@ -639,6 +709,12 @@ rspec-ee system pg12 minimal:
- .minimal-rspec-tests - .minimal-rspec-tests
- .rails:rules:ee-only-system:minimal - .rails:rules:ee-only-system:minimal
rspec-ee system pg12 decomposed:
extends:
- rspec-ee system pg12
- .decomposed-database-rspec
- .rails:rules:decomposed-databases
rspec-ee unit pg12 geo: rspec-ee unit pg12 geo:
extends: extends:
- .rspec-ee-base-geo-pg12 - .rspec-ee-base-geo-pg12
......
...@@ -46,6 +46,9 @@ ...@@ -46,6 +46,9 @@
.if-merge-request-title-run-all-rspec: &if-merge-request-title-run-all-rspec .if-merge-request-title-run-all-rspec: &if-merge-request-title-run-all-rspec
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-all-rspec/' if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-all-rspec/'
.if-merge-request-run-decomposed: &if-merge-request-run-decomposed
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-decomposed/'
.if-security-merge-request: &if-security-merge-request .if-security-merge-request: &if-security-merge-request
if: '$CI_PROJECT_NAMESPACE == "gitlab-org/security" && $CI_MERGE_REQUEST_IID' if: '$CI_PROJECT_NAMESPACE == "gitlab-org/security" && $CI_MERGE_REQUEST_IID'
...@@ -607,6 +610,11 @@ ...@@ -607,6 +610,11 @@
############### ###############
# Rails rules # # Rails rules #
############### ###############
.rails:rules:decomposed-databases:
rules:
- <<: *if-merge-request-run-decomposed
allow_failure: true
.rails:rules:ee-and-foss-migration: .rails:rules:ee-and-foss-migration:
rules: rules:
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
......
#
# Development specific
#
development:
main:
adapter: postgresql
encoding: unicode
database: gitlabhq_development
username: postgres
password: "secure password"
host: localhost
variables:
statement_timeout: 15s
ci:
adapter: postgresql
encoding: unicode
database: gitlabhq_development_ci
username: postgres
password: "secure password"
host: localhost
variables:
statement_timeout: 15s
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &test
main:
adapter: postgresql
encoding: unicode
database: gitlabhq_test
username: postgres
password:
host: localhost
prepared_statements: false
variables:
statement_timeout: 15s
ci:
adapter: postgresql
encoding: unicode
database: gitlabhq_test_ci
username: postgres
password:
host: localhost
prepared_statements: false
variables:
statement_timeout: 15s
...@@ -10,7 +10,12 @@ fi ...@@ -10,7 +10,12 @@ fi
cp config/gitlab.yml.example config/gitlab.yml cp config/gitlab.yml.example config/gitlab.yml
sed -i 's/bin_path: \/usr\/bin\/git/bin_path: \/usr\/local\/bin\/git/' config/gitlab.yml sed -i 's/bin_path: \/usr\/bin\/git/bin_path: \/usr\/local\/bin\/git/' config/gitlab.yml
cp config/database.yml.postgresql config/database.yml if [ "$DECOMPOSED_DB" == "true" ]; then
echo "Using decomposed database config (config/database.yml.decomposed-postgresql)"
cp config/database.yml.decomposed-postgresql config/database.yml
else
cp config/database.yml.postgresql config/database.yml
fi
if [ -f config/database_geo.yml.postgresql ]; then if [ -f config/database_geo.yml.postgresql ]; then
cp config/database_geo.yml.postgresql config/database_geo.yml cp config/database_geo.yml.postgresql config/database_geo.yml
......
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