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
This commit is contained in:
Stan Hu 2017-12-27 05:41:28 -08:00
parent ff077cf7dc
commit ad88e3f88d
3 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -8,7 +8,7 @@ end
module Gitlab
class Seeder
def self.quiet
mute_mailer unless Rails.env.test?
mute_mailer
SeedFu.quiet = true

View file

@ -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;