From 2a94bf741e6798158dbdfefd88667f7075a4e8b2 Mon Sep 17 00:00:00 2001 From: Simon Hughesdon Date: Tue, 2 Apr 2019 12:38:49 +0100 Subject: [PATCH] Add minitest reporters This helps troubleshoot flaky tests by printing the name and duration of each test as it runs. --- Gemfile | 1 + Gemfile.lock | 9 ++++++++- test/test_helper.rb | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 87d219591..bdf194a5f 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,7 @@ group :test do gem 'capybara' gem 'chromedriver-helper' gem 'faker' + gem 'minitest-reporters' gem 'mocha' gem 'puma' gem 'selenium-webdriver' diff --git a/Gemfile.lock b/Gemfile.lock index f21f61bce..b3479f97f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,6 +47,7 @@ GEM anemone (0.7.2) nokogiri (>= 1.3.0) robotex (>= 1.0.0) + ansi (1.5.0) archive-zip (0.11.0) io-like (~> 0.3.0) arel (9.0.0) @@ -180,6 +181,11 @@ GEM mini_mime (1.0.1) mini_portile2 (2.4.0) minitest (5.11.3) + minitest-reporters (1.3.6) + ansi + builder + minitest (>= 5.0) + ruby-progressbar mocha (1.8.0) metaclass (~> 0.0.1) money (6.13.2) @@ -370,6 +376,7 @@ DEPENDENCIES govuk_schemas (~> 3.2) htmlentities (~> 4.3) jasmine-rails + minitest-reporters mocha plek (~> 2.1) pry-byebug @@ -390,4 +397,4 @@ RUBY VERSION ruby 2.6.1p33 BUNDLED WITH - 1.17.1 + 1.17.3 diff --git a/test/test_helper.rb b/test/test_helper.rb index a93f89026..5746658a9 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -8,9 +8,12 @@ require 'mocha/minitest' require 'capybara/minitest' require 'faker' +require "minitest/reporters" Dir[Rails.root.join('test/support/*.rb')].each { |f| require f } +Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new + Capybara.register_driver :headless_chrome do |app| capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( chromeOptions: { args: %w(headless disable-gpu no-sandbox) }