summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2019-05-22 13:10:19 +0200
committerRémy Coutable <remy@rymai.me>2019-05-22 21:47:32 +0200
commitd02d3e34dd8a1d2da9106e41918bfdd7a988e904 (patch)
treed5c828c03676c89958d83409bb74339b5473f3d6
parent6145ddf515f93fcc7ed873b911b6369cc2bc0462 (diff)
downloadgitlab-ce-d02d3e34dd8a1d2da9106e41918bfdd7a988e904.tar.gz
Fix MySQL CI jobs
[run mysql] Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--.gitlab/ci/rails.gitlab-ci.yml26
-rw-r--r--scripts/prepare_build.sh10
2 files changed, 28 insertions, 8 deletions
diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml
index 346fa47cbb5..3f0c899d704 100644
--- a/.gitlab/ci/rails.gitlab-ci.yml
+++ b/.gitlab/ci/rails.gitlab-ci.yml
@@ -188,6 +188,27 @@ rspec system mysql:
<<: *only-schedules-master
parallel: 24
+.rspec-mysql-on-demand: &rspec-mysql-on-demand
+ only:
+ variables:
+ - $CI_COMMIT_MESSAGE =~ /\[run mysql\]/i
+ - $CI_COMMIT_REF_NAME =~ /mysql/
+
+rspec unit mysql on-demand:
+ <<: *rspec-metadata-mysql
+ <<: *rspec-mysql-on-demand
+ parallel: 20
+
+rspec integration mysql on-demand:
+ <<: *rspec-metadata-mysql
+ <<: *rspec-mysql-on-demand
+ parallel: 6
+
+rspec system mysql on-demand:
+ <<: *rspec-metadata-mysql
+ <<: *rspec-mysql-on-demand
+ parallel: 24
+
rspec-fast-spec-helper:
<<: *rspec-metadata-pg
script:
@@ -200,14 +221,15 @@ rspec-fast-spec-helper:
- scripts/gitaly-test-spawn
- bin/rspec --color --format documentation --tag quarantine -- spec/
-rspec-pg-quarantine:
+rspec quarantine pg:
<<: *rspec-metadata-pg
<<: *rspec-quarantine
allow_failure: true
-rspec-mysql-quarantine:
+rspec quarantine mysql:
<<: *rspec-metadata-mysql
<<: *rspec-quarantine
+ <<: *only-schedules-master
allow_failure: true
static-analysis:
diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh
index 5fca95f1f40..9b0d5d4f719 100644
--- a/scripts/prepare_build.sh
+++ b/scripts/prepare_build.sh
@@ -17,12 +17,10 @@ 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
# Determine the database by looking at the job name.
-# For example, we'll get pg if the job is `rspec-pg 19 20`
-export GITLAB_DATABASE=$(echo $CI_JOB_NAME | cut -f1 -d' ' | cut -f2 -d-)
-
-# This would make the default database postgresql, and we could also use
-# pg to mean postgresql.
-if [ "$GITLAB_DATABASE" != 'mysql' ]; then
+# This would make the default database postgresql.
+if [[ "${CI_JOB_NAME#*mysql}" != "$CI_JOB_NAME" ]]; then
+ export GITLAB_DATABASE='mysql'
+else
export GITLAB_DATABASE='postgresql'
fi