Кажется, я не могу понять, как подавить множество rvm
связанных строк, которые заполняют результаты теста.
Схема, которую я описал ниже, раньше работала просто отлично, но, похоже, больше не работает.
Есть идеи, что еще можно попробовать? Спасибо!
- Ruby 2.7.0
- Рельсы 6.0.2.2
образец тестового выхода
12:54:34 - INFO - Running: test/models/user_test.rb
Running via Spring preloader in process 8628
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activemodel-6.0.2.2/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activemodel-6.0.2.2/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activemodel-6.0.2.2/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
Started with run options --seed 59569
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/transactions.rb:212: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call--=---=---=---=---=---=---] 0% Time: 00:00:00, ETA: ??:??:??
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:274: warning: The called method `transaction' is defined here
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:145: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:78: warning: The called method `initialize' is defined here
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/relation/delegation.rb:115: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/relation.rb:27: warning: The called method `initialize' is defined here
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/persistence.rb:470: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/timestamp.rb:127: warning: The called method `create_or_update' is defined here
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activemodel-6.0.2.2/lib/active_model/naming.rb:206: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `translate' is defined here
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activemodel-6.0.2.2/lib/active_model/translation.rb:67: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `translate' is defined here
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activemodel-6.0.2.2/lib/active_model/errors.rb:500: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `translate' is defined here
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activemodel-6.0.2.2/lib/active_model/errors.rb:514: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `translate' is defined here
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/attribute_methods/dirty.rb:102: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call ] 16% Time: 00:00:03, ETA: 00:00:16
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activemodel-6.0.2.2/lib/active_model/attribute_mutation_tracker.rb:45: warning: The called method `changed?' is defined here
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/attribute_methods/dirty.rb:52: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activemodel-6.0.2.2/lib/active_model/attribute_mutation_tracker.rb:45: warning: The called method `changed?' is defined here
You are not able to decline a task that was not offered to you.
testing: [=========================================================================================================================================== ] 61% Time: 00:00:03, ETA: 00:00:02
You are not allowed to accept a task that was not offered to you.============================================================================================================= ] 72% Time: 00:00:03, ETA: 00:00:01
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/persistence.rb:503: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call ] 83% Time: 00:00:03, ETA: 00:00:01
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/activerecord-6.0.2.2/lib/active_record/timestamp.rb:127: warning: The called method `create_or_update' is defined here
18/18: [===================================================================================================================================================================================================================================] 100% Time: 00:00:03, Time: 00:00:03
Finished in 3.29458s
18 tests, 27 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for Minitest to /home/linux/Programming/Projects/land_app/coverage/coverage.json. 538 / 717 LOC (75.03%) covered.
<main>:1: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/pry-0.12.2/lib/pry/commands/whereami.rb:40: warning: in `eval'
<main>:1: warning: __LINE__ in eval may not return location in binding; use Binding#source_location instead
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/pry-0.12.2/lib/pry/commands/whereami.rb:41: warning: in `eval'
<main>:1: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/pry-0.12.2/lib/pry/method/weird_method_locator.rb:88: warning: in `eval'
<main>:1: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/home/linux/.rvm/gems/ruby-2.7.0@land_app/gems/pry-0.12.2/lib/pry/method/weird_method_locator.rb:80: warning: in `eval'
[1] guard(main)>
test / test_helper.rb
ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
require 'minitest/reporters'
require 'simplecov'
require 'simplecov-json'
# For factory_bot integration
# require 'support/factory_bot'
# require 'factory_bot_rails' # QUESTION: Are these lines required? Stated properly?
# Capybara settings, also continued below in the ActionDispatch::IntegrationTest class setup
require 'capybara/rails'
require 'capybara/minitest'
# Integrate AASM gem's custom testing methods into minitest
require 'aasm/minitest'
require 'database_cleaner'
SimpleCov.start
SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
Capybara.default_driver = :selenium
Capybara.javascript_driver = :webkit
# https://github.com/thoughtbot/capybara-webkit
Capybara::Webkit.configure do |config|
...
end
# https://github.com/kern/minitest-reporters
Minitest::Reporters.use!(
Minitest::Reporters::ProgressReporter.new(:color => true),
ENV,
Minitest.backtrace_filter
)
DatabaseCleaner.strategy = :transaction
# NOTE: This module is meant to have DatabaseCleaner do it's thing during each test that is ran
module AroundEachTest
def before_setup
super
DatabaseCleaner.clean
DatabaseCleaner.start
end
end
class ActiveSupport::TestCase
include ApplicationHelper
include ActionDispatch::TestProcess
...
end
class ActionDispatch::IntegrationTest
...
end
config / initializers / backtrace_silencers.rb
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
Rails.backtrace_cleaner.add_silencer { |line| line =~ /rvm/ }
Gemfile
* aasm (5.0.8)
* actioncable (6.0.2.2)
* actionmailbox (6.0.2.2)
* actionmailer (6.0.2.2)
* actionpack (6.0.2.2)
* actiontext (6.0.2.2)
* actionview (6.0.2.2)
* active_record_query_trace (1.7)
* activejob (6.0.2.2)
* activemodel (6.0.2.2)
* activerecord (6.0.2.2)
* activestorage (6.0.2.2)
* activesupport (6.0.2.2)
* addressable (2.7.0)
* ansi (1.5.0)
* area (0.10.0)
* autoprefixer-rails (9.7.6)
* aws-eventstream (1.0.3)
* aws-partitions (1.295.0)
* aws-sdk-core (3.93.0)
* aws-sdk-kms (1.30.0)
* aws-sdk-s3 (1.61.2)
* aws-sigv4 (1.1.1)
* bcrypt (3.1.13)
* better_errors (2.6.0)
* bindex (0.8.1)
* binding_of_caller (0.8.0)
* bootstrap-sass (3.4.1)
* bootstrap-will_paginate (1.0.0)
* brakeman (4.8.1)
* builder (3.2.4)
* bullet (6.1.0)
* bundler (2.0.2)
* bundler-audit (0.6.1)
* capybara (3.32.1)
* capybara-webkit (1.15.1)
* childprocess (3.0.0)
* chronic (0.10.2)
* coderay (1.1.2)
* coffee-rails (4.2.2)
* coffee-script (2.4.1)
* coffee-script-source (1.12.2)
* concurrent-ruby (1.1.6)
* connection_pool (2.2.2)
* content_disposition (1.0.0)
* crass (1.0.6)
* database_cleaner (1.8.4)
* debug_inspector (0.0.3)
* docile (1.3.2)
* down (5.1.1)
* erubi (1.9.0)
* execjs (2.7.0)
* faker (2.10.2)
* fastercsv (1.5.5)
* fastimage (2.1.7)
* ffi (1.12.2)
* formatador (0.2.5)
* fuzzy_match (2.1.0)
* geocoder (1.6.2)
* globalid (0.4.2)
* guard (2.16.2)
* guard-compat (1.2.1)
* guard-minitest (2.4.6)
* i18n (1.8.2)
* image_processing (1.10.3)
* inline_svg (1.7.1)
* jbuilder (2.10.0)
* jmespath (1.4.0)
* jquery-rails (4.3.5)
* jquery-ui-rails (6.0.1)
* json (2.3.0)
* listen (3.2.1)
* loofah (2.5.0)
* lumberjack (1.2.4)
* mail (2.7.1)
* marcel (0.3.3)
* method_source (0.9.2)
* mimemagic (0.3.4)
* mini_magick (4.10.1)
* mini_mime (1.0.2)
* mini_portile2 (2.4.0)
* minitest (5.14.0)
* minitest-around (0.5.0)
* minitest-reporters (1.4.2)
* nenv (0.3.0)
* nio4r (2.5.2)
* nokogiri (1.10.9)
* notiffany (0.1.3)
* papertrail (0.11.0)
* pg (1.2.3)
* popper_js (1.16.0)
* pry (0.12.2)
* pry-rails (0.3.9)
* public_suffix (4.0.4)
* puma (4.3.3)
* rack (2.2.2)
* rack-protection (2.0.8.1)
* rack-proxy (0.6.5)
* rack-test (1.1.0)
* rails (6.0.2.2)
* rails-controller-testing (1.0.4)
* rails-dom-testing (2.0.3)
* rails-html-sanitizer (1.3.0)
* railties (6.0.2.2)
* rake (13.0.1)
* rb-fsevent (0.10.3)
* rb-inotify (0.10.1)
* redis (4.1.3)
* regexp_parser (1.7.0)
* ruby-progressbar (1.10.1)
* ruby-vips (2.0.17)
* rubyzip (2.3.0)
* sassc (2.0.1)
* sassc-rails (2.1.2)
* selenium-webdriver (3.142.7)
* semantic_range (2.3.0)
* shellany (0.0.1)
* shrine (2.19.4)
* shrine-memory (0.3.1)
* sidekiq (6.0.6)
* simple_form (5.0.2)
* simplecov (0.18.5)
* simplecov-html (0.12.2)
* simplecov-json (0.2.1)
* spring (2.1.0)
* spring-watcher-listen (2.0.1)
* sprockets (4.0.0)
* sprockets-rails (3.2.1)
* thor (0.20.3)
* thread_safe (0.3.6)
* tilt (2.0.10)
* turbolinks (5.2.1)
* turbolinks-source (5.2.0)
* tzinfo (1.2.7)
* uglifier (4.2.0)
* uniform_notifier (1.13.0)
* web-console (4.0.1)
* webdrivers (4.2.0)
* webpacker (5.0.1)
* websocket-driver (0.7.1)
* websocket-extensions (0.1.4)
* will_paginate (3.3.0)
* xpath (3.2.0)
* zeitwerk (2.3.0)