Skip to content

Provide Rails-specific tools, possibly as a wrapper around Rails commands #248

@mmenanno

Description

@mmenanno

This is a follow up to #245. While the stringio issue seems to be resolved, something recursive seems to still be happening with the toys minitest integration loading.

If we use the same minimal replication setup:

rails new test_application 
cd test_appliction
bundle add toys

Then I creating a .toys.rb with this as the content:

expand :minitest, files: ["test/**/*_test.rb"], libs: ["test", "lib"]

Running rake test works as expected but toys test shows this warning:
/Users/username/.gem/ruby/3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:8: warning: method redefined; discarding old require

To show the other example that is still happening here with this loading if you run bundle add bugsnag.

Then again running rake test works as expected but toys test shows this warning:

<internal:/Users/username/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37: warning: <internal:/Users/username/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37: warning: loading in progress, circular require considered harmful - /Users/username/.gem/ruby/3.2.2/gems/bugsnag-6.26.0/lib/bugsnag.rb
        from -e:1:in  `<main>'
        from -e:1:in  `load'
        from test/channels/application_cable/connection_test.rb:1:in  `<top (required)>'
        from <internal:/Users/username/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in  `require'
        from <internal:/Users/username/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in  `require'
        from /Users/username/dev/git/test/test_application/test/test_helper.rb:2:in  `<top (required)>'
        from /Users/username/dev/git/test/test_application/test/test_helper.rb:2:in  `require_relative'
        from /Users/username/dev/git/test/test_application/config/environment.rb:2:in  `<top (required)>'
        from /Users/username/dev/git/test/test_application/config/environment.rb:2:in  `require_relative'
        from /Users/username/dev/git/test/test_application/config/application.rb:7:in  `<top (required)>'
        from /Users/username/.gem/ruby/3.2.2/gems/bundler-2.4.21/lib/bundler.rb:187:in  `require'
        from /Users/username/.gem/ruby/3.2.2/gems/bundler-2.4.21/lib/bundler/runtime.rb:44:in  `require'
        from /Users/username/.gem/ruby/3.2.2/gems/bundler-2.4.21/lib/bundler/runtime.rb:44:in  `each'
        from /Users/username/.gem/ruby/3.2.2/gems/bundler-2.4.21/lib/bundler/runtime.rb:55:in  `block in require'
        from /Users/username/.gem/ruby/3.2.2/gems/bundler-2.4.21/lib/bundler/runtime.rb:55:in  `each'
        from /Users/username/.gem/ruby/3.2.2/gems/bundler-2.4.21/lib/bundler/runtime.rb:60:in  `block (2 levels) in require'
        from /Users/username/.gem/ruby/3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in  `require'
        from /Users/username/.gem/ruby/3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in  `require'
        from <internal:/Users/username/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in  `require'
        from <internal:/Users/username/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in  `require'
        from /Users/username/.gem/ruby/3.2.2/gems/bugsnag-6.26.0/lib/bugsnag.rb:579:in  `<main>'
        from /Users/username/.gem/ruby/3.2.2/gems/bugsnag-6.26.0/lib/bugsnag.rb:251:in  `load_integrations'
        from /Users/username/.gem/ruby/3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in  `require'
        from /Users/username/.gem/ruby/3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in  `require'
        from <internal:/Users/username/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in  `require'
        from <internal:/Users/username/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in  `require'
        from /Users/username/.gem/ruby/3.2.2/gems/bugsnag-6.26.0/lib/bugsnag/integrations/railtie.rb:5:in  `<main>'
        from /Users/username/.gem/ruby/3.2.2/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in  `require'
        from /Users/username/.gem/ruby/3.2.2/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in  `require'
        from <internal:/Users/username/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in  `require'
        from <internal:/Users/username/.rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in  `require'

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions