Minitest output too long

848 Views Asked by At

I'm using minitest-reporters and mini_backtrace gems with the settings from the Hartl tutorial. The output of my tests are way too long. The output includes a lot of sql and also lists each test.

enter image description here

Based on this question, the sql can be suppressed with:

ActiveRecord::Base.logger.level = 1

but how do I suppress the listing of each test? This is the output I'd like from the minitest-reporters gem's documentation:

enter image description here

How do I get a simple output like that?

1

There are 1 best solutions below

3
On

Please use the Logger constants instead of arbitrary numbers: Logger::INFO for instance. Also, the ActiveRecord log shouldn't appear on STDOUT, but go into a log file. You may replace ActiceRecord::Base.logger with Logger.new("log/test.log") for example.

If you don't have the expected output from minitest-reporters, you'll may want to force the default reporter:

Minitest::Reporters.use! Minitest::Reporters::DefaultReporter