From 15423e0b7b26ae0d6bce014f8b172d172a69ec1d Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 10 Jun 2020 17:52:33 -0500 Subject: [PATCH] tests: add progress bar to test output. Add minitest-reporters gem. Replace the default output of `bin/rails test` with a progress bar. The default output just emits periods for passed tests, which makes it hard to tell how long tests will take and causes test runner output on Github to appear to hang. The web console on Github is line buffered, but the default test runner doesn't normally emit newlines (unless a test fails), so the output can hang for a long time. --- Gemfile | 1 + Gemfile.lock | 7 +++++++ test/test_helper.rb | 3 +++ 3 files changed, 11 insertions(+) diff --git a/Gemfile b/Gemfile index 635fd19ea..2f382caa4 100644 --- a/Gemfile +++ b/Gemfile @@ -88,6 +88,7 @@ group :test do gem "simplecov", :require => false gem "webmock" gem "minitest-ci" + gem "minitest-reporters" gem "mock_redis" gem "capybara" gem "selenium-webdriver" diff --git a/Gemfile.lock b/Gemfile.lock index d16a71323..78ea389ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,6 +74,7 @@ GEM public_suffix (>= 2.0.2, < 5.0) airbrussh (1.4.0) sshkit (>= 1.6.1, != 1.7.0) + ansi (1.5.0) ast (2.4.0) aws-eventstream (1.1.0) aws-partitions (1.326.0) @@ -214,6 +215,11 @@ GEM minitest (5.14.1) minitest-ci (3.4.0) minitest (>= 5.0.6) + minitest-reporters (1.4.2) + ansi + builder + minitest (>= 5.0) + ruby-progressbar mocha (1.11.2) mock_redis (0.23.0) msgpack (1.3.3) @@ -453,6 +459,7 @@ DEPENDENCIES memory_profiler meta_request minitest-ci + minitest-reporters mocha mock_redis net-sftp diff --git a/test/test_helper.rb b/test/test_helper.rb index 1305c401e..5a100fb3b 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -13,6 +13,9 @@ require 'rails/test_help' require 'cache' require 'webmock/minitest' require 'mocha/minitest' +require 'minitest/reporters' + +Minitest::Reporters.use!(Minitest::Reporters::ProgressReporter.new) Dir[File.expand_path(File.dirname(__FILE__) + "/factories/*.rb")].sort.each {|file| require file} Dir[File.expand_path(File.dirname(__FILE__) + "/test_helpers/*.rb")].sort.each {|file| require file}