summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-07-18 19:29:35 +0000
committerRémy Coutable <remy@rymai.me>2017-07-18 19:29:35 +0000
commit3f50f6ca5b4f1e45eecdff588d3ac7f5935f6de8 (patch)
treea8ec6e854bcd8e73a756e52ce054b29c2a9bea42
parent6be27bea98022419ca07b82a2126b4d69d45ad70 (diff)
parentfc76ff1051681a7cabc1203043217b617e85f068 (diff)
downloadgitlab-ce-3f50f6ca5b4f1e45eecdff588d3ac7f5935f6de8.tar.gz
Merge branch 'rs-disable-test-log-in-ci' into 'master'
Disable Rails logging in CI test environments See merge request !12847
-rw-r--r--config/environments/test.rb5
-rw-r--r--doc/development/testing.md5
2 files changed, 10 insertions, 0 deletions
diff --git a/config/environments/test.rb b/config/environments/test.rb
index c3b788c038e..986107150cf 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -43,4 +43,9 @@ Rails.application.configure do
config.cache_store = :null_store
config.active_job.queue_adapter = :test
+
+ if ENV['CI'] && !ENV['RAILS_ENABLE_TEST_LOG']
+ config.logger = Logger.new(nil)
+ config.log_level = :fatal
+ end
end
diff --git a/doc/development/testing.md b/doc/development/testing.md
index cf3ea2ccfc2..fc84932354b 100644
--- a/doc/development/testing.md
+++ b/doc/development/testing.md
@@ -479,6 +479,11 @@ slowest test files and try to improve them.
run the suite against MySQL for tags, `master`, and any branch that includes
`mysql` in the name.
- On EE, the test suite always runs both PostgreSQL and MySQL.
+- Rails logging to `log/test.log` is disabled by default in CI [for
+ performance reasons][logging]. To override this setting, provide the
+ `RAILS_ENABLE_TEST_LOG` environment variable.
+
+[logging]: https://jtway.co/speed-up-your-rails-test-suite-by-6-in-1-line-13fedb869ec4
## Spinach (feature) tests