Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rake_test_loader swallowed a load error #247

Closed
abevoelker opened this issue Jan 11, 2018 · 1 comment
Closed

rake_test_loader swallowed a load error #247

abevoelker opened this issue Jan 11, 2018 · 1 comment

Comments

@abevoelker
Copy link

This rescue in rake_test_loader.rb:

rescue LoadError => e
abort "\nFile does not exist: #{e.path}\n\n"
end

is outputting an empty "File does not exist: " in the following Travis CI build: https://travis-ci.org/alexreisner/geocoder/jobs/327410878#L951

When I comment out the rescue, I get a more useful error message indicating the underlying gem load issue:

/home/travis/.rvm/gems/ruby-2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/load_error.rb:9: warning: method redefined; discarding old path
/home/travis/.rvm/gems/ruby-2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/time/calculations.rb:333: warning: method redefined; discarding old +
/home/travis/.rvm/gems/ruby-2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/time/calculations.rb:343: warning: method redefined; discarding old -
/home/travis/.rvm/gems/ruby-2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/time/calculations.rb:353: warning: method redefined; discarding old -
/home/travis/.rvm/gems/ruby-2.3.0/gems/bundler-1.16.1/lib/bundler/rubygems_integration.rb:404:in `block (2 levels) in replace_gem': Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (can't activate pg (~> 0.11), already activated pg-1.0.0. Make sure all dependencies are added to Gemfile.) (LoadError)
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/postgresql_adapter.rb:7:in `<top (required)>'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `require'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `block in require'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in `load_dependency'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `require'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in `resolve_hash_connection'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in `resolve_string_connection'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:27:in `spec'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/activerecord-3.2.22.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection'
        from /home/travis/alexreisner/geocoder/test/test_helper.rb:23:in `<top (required)>'
        from /home/travis/alexreisner/geocoder/test/unit/active_record_test.rb:2:in `require'
        from /home/travis/alexreisner/geocoder/test/unit/active_record_test.rb:2:in `<top (required)>'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/rake-12.3.0/lib/rake/rake_test_loader.rb:17:in `require'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/rake-12.3.0/lib/rake/rake_test_loader.rb:17:in `block in <main>'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/rake-12.3.0/lib/rake/rake_test_loader.rb:5:in `select'
        from /home/travis/.rvm/gems/ruby-2.3.0/gems/rake-12.3.0/lib/rake/rake_test_loader.rb:5:in `<main>'
rake aborted!
Command failed with status (1)
/home/travis/.rvm/gems/ruby-2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/home/travis/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => default => test
(See full trace by running task with --trace)
@dylanahsmith
Copy link
Contributor

Regression from #195. cc @drbrain

How about we re-raise the exception if it doesn't have a path? I.e. raise unless e.path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants