lzap
November 3, 2017, 1:51pm
1
Hey,
just to want to increase visiblity of this patch:
theforeman:develop
← lzap:rails-logs-tests-20559
opened 08:22AM - 11 Aug 17 UTC
When there is a test failure, it is usually impossible to find the correct log i… n logs/test.log file for paritular failed tests. This patch automatically adds Rails logs (including ActiveRecord) to STDOUT for every single test failure, so it's visible. Each log transaction starts with "Rails logs for [name of the test] FAILURE" so it's easy to grep it.
This hooks into `ActiveSupport::TestCase`, so make sure you do not use Minitest::Test directly. We do not do that, there was just a one test which was changed.
Remember, if you run into issues on Jenkins, open full console output and search for "Rails logs" to find the logs for failed tests!
In short, when you have a test failure, there should be a relevant
Rails log printed on standard output. You can opt-out this via ENV
variable if you don't like this, but I find this very useful
particularly on our Jenkins when debugging tests.
···
--
Later,
Lukas @lzap Zapletal