diff options
author | Stan Hu <stanhu@gmail.com> | 2017-12-27 05:41:28 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-01-02 12:44:51 -0800 |
commit | ad88e3f88d2ac287f5a95952f95da4feae90944e (patch) | |
tree | b4cbd1c5722fdfe2c15ac24588c8c74b94a21f22 | |
parent | ff077cf7dc5cfd7c6c6206d801ea3f326f7af1aa (diff) | |
download | gitlab-ce-sh-fix-seed-fu-ci.tar.gz |
Fix `rake db:seed_fu` not doing anything in CIsh-fix-seed-fu-ci
The default behavior of seed_fu is to load the fixtures using the RAILS_ENV
environment. In CI, since we set RAILS_ENV=test, nothing is ever
loaded. Instead of `rake db:seed_fu`, use `rake gitlab:setup`, which sets up
MySQL properly with limits.
Closes #41517
-rw-r--r-- | .gitlab-ci.yml | 4 | ||||
-rw-r--r-- | lib/gitlab/seeder.rb | 2 | ||||
-rw-r--r-- | scripts/create_mysql_user.sh | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ca2fb471aa..e98ac200332 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -517,10 +517,12 @@ db:rollback-mysql: SIZE: "1" SETUP_DB: "false" CREATE_DB_USER: "true" + FIXTURE_PATH: db/fixtures/development script: - git clone https://gitlab.com/gitlab-org/gitlab-test.git /home/git/repositories/gitlab-org/gitlab-test.git - - bundle exec rake db:setup db:seed_fu + - scripts/gitaly-test-spawn + - force=yes bundle exec rake gitlab:setup artifacts: when: on_failure expire_in: 1d diff --git a/lib/gitlab/seeder.rb b/lib/gitlab/seeder.rb index 30df7e4a831..94a481a0f2e 100644 --- a/lib/gitlab/seeder.rb +++ b/lib/gitlab/seeder.rb @@ -8,7 +8,7 @@ end module Gitlab class Seeder def self.quiet - mute_mailer unless Rails.env.test? + mute_mailer SeedFu.quiet = true diff --git a/scripts/create_mysql_user.sh b/scripts/create_mysql_user.sh index 28f6cfb50ae..286b1325f1d 100644 --- a/scripts/create_mysql_user.sh +++ b/scripts/create_mysql_user.sh @@ -1,7 +1,7 @@ #!/bin/bash mysql --user=root --host=mysql <<EOF -CREATE DATABASE IF NOT EXISTS gitlabhq_test; +CREATE DATABASE IF NOT EXISTS gitlabhq_test DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; CREATE USER IF NOT EXISTS 'gitlab'@'%'; GRANT ALL PRIVILEGES ON gitlabhq_test.* TO 'gitlab'@'%'; FLUSH PRIVILEGES; |