From ad88e3f88d2ac287f5a95952f95da4feae90944e Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 27 Dec 2017 05:41:28 -0800 Subject: Fix `rake db:seed_fu` not doing anything in 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 --- .gitlab-ci.yml | 4 +++- lib/gitlab/seeder.rb | 2 +- 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 <