rails/rails — Issue #5257: Running only sqlite3 AR tests tries running mysql tests throwing errors
Author: rohit
Created: 2012-03-03 12:40:49+00:00
State: open

In the Contribute to Rails guide, http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html#testing-active-record ― it mentions that you can run AR sqlite3 tests without installing the `:db` bundle group. However doing so on master throws quite a few errors. I've included only the errors in the following, for the full output => https://gist.github.com/dbd16a997aa93321dd95

```
[master](1.9.3-p0@rails-master) (~/projects/rails/activerecord)
९ bundle exec rake test sqlite3
...
Using mysql with Identity Map off
/home/rohit/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler/rubygems_integration.rb:143:in `block in replace_gem': Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.) (LoadError)
from /home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:5:in `'
from /home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
from /home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `block in require'
from /home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
from /home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:53:in `resolve_hash_connection'
from /home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:44:in `resolve_string_connection'
from /home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:30:in `spec'
from /home/rohit/projects/rails/activerecord/lib/active_record/connection_handling.rb:41:in `establish_connection'
from /home/rohit/projects/rails/activerecord/test/support/connection.rb:18:in `connect'
from /home/rohit/projects/rails/activerecord/test/cases/helper.rb:29:in `'
from /home/rohit/projects/rails/activerecord/test/cases/adapter_test.rb:1:in `require'
from /home/rohit/projects/rails/activerecord/test/cases/adapter_test.rb:1:in `'
from /home/rohit/.rvm/gems/ruby-1.9.3-p0@rails-master/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:15:in `require'
from /home/rohit/.rvm/gems/ruby-1.9.3-p0@rails-master/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:15:in `block in

'
from /home/rohit/.rvm/gems/ruby-1.9.3-p0@rails-master/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `select'
from /home/rohit/.rvm/gems/ruby-1.9.3-p0@rails-master/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `

'
...

Finished tests in 98.780345s, 33.6808 tests/s, 102.7026 assertions/s.

1) Error:
test_url_host_db(ActiveRecord::ConnectionAdapters::ConnectionSpecification::ResolverTest):
LoadError: Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.)
/home/rohit/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler/rubygems_integration.rb:143:in `block in replace_gem'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:5:in `'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `block in require'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:53:in `resolve_hash_connection'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:44:in `resolve_string_connection'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:30:in `spec'
/home/rohit/projects/rails/activerecord/test/cases/connection_specification/resolver_test.rb:8:in `resolve'
/home/rohit/projects/rails/activerecord/test/cases/connection_specification/resolver_test.rb:21:in `test_url_host_db'
/home/rohit/.rvm/gems/ruby-1.9.3-p0@rails-master/gems/mocha-0.10.5/lib/mocha/integration/mini_test/version_230_to_262.rb:28:in `run'
/home/rohit/projects/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:29:in `block in run'
/home/rohit/projects/rails/activesupport/lib/active_support/callbacks.rb:364:in `_run__4562762730723704933__setup__callbacks'
/home/rohit/projects/rails/activesupport/lib/active_support/callbacks.rb:346:in `__run_callbacks'
/home/rohit/projects/rails/activesupport/lib/active_support/callbacks.rb:79:in `run_callbacks'
/home/rohit/projects/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:28:in `run'

2) Error:
test_url_host_no_db(ActiveRecord::ConnectionAdapters::ConnectionSpecification::ResolverTest):
LoadError: Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.)
/home/rohit/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler/rubygems_integration.rb:143:in `block in replace_gem'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:5:in `'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `block in require'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:53:in `resolve_hash_connection'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:44:in `resolve_string_connection'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:30:in `spec'
/home/rohit/projects/rails/activerecord/test/cases/connection_specification/resolver_test.rb:8:in `resolve'
/home/rohit/projects/rails/activerecord/test/cases/connection_specification/resolver_test.rb:12:in `test_url_host_no_db'
/home/rohit/.rvm/gems/ruby-1.9.3-p0@rails-master/gems/mocha-0.10.5/lib/mocha/integration/mini_test/version_230_to_262.rb:28:in `run'
/home/rohit/projects/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:29:in `block in run'
/home/rohit/projects/rails/activesupport/lib/active_support/callbacks.rb:364:in `_run__4562762730723704933__setup__callbacks'
/home/rohit/projects/rails/activesupport/lib/active_support/callbacks.rb:346:in `__run_callbacks'
/home/rohit/projects/rails/activesupport/lib/active_support/callbacks.rb:79:in `run_callbacks'
/home/rohit/projects/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:28:in `run'

3) Error:
test_url_port(ActiveRecord::ConnectionAdapters::ConnectionSpecification::ResolverTest):
LoadError: Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.)
/home/rohit/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler/rubygems_integration.rb:143:in `block in replace_gem'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:5:in `'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `block in require'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/rohit/projects/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:53:in `resolve_hash_connection'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:44:in `resolve_string_connection'
/home/rohit/projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:30:in `spec'
/home/rohit/projects/rails/activerecord/test/cases/connection_specification/resolver_test.rb:8:in `resolve'
/home/rohit/projects/rails/activerecord/test/cases/connection_specification/resolver_test.rb:30:in `test_url_port'
/home/rohit/.rvm/gems/ruby-1.9.3-p0@rails-master/gems/mocha-0.10.5/lib/mocha/integration/mini_test/version_230_to_262.rb:28:in `run'
/home/rohit/projects/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:29:in `block in run'
/home/rohit/projects/rails/activesupport/lib/active_support/callbacks.rb:364:in `_run__4562762730723704933__setup__callbacks'
/home/rohit/projects/rails/activesupport/lib/active_support/callbacks.rb:346:in `__run_callbacks'
/home/rohit/projects/rails/activesupport/lib/active_support/callbacks.rb:79:in `run_callbacks'
/home/rohit/projects/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:28:in `run'
```

Okay this is only the partial output of running the tests. Please see https://gist.github.com/dbd16a997aa93321dd95 for the full output including all the errors.

I will investigate this further and report back or close the issue if I set up something wrongly. Just made a note of it before proceeded to set up AR testing for other DB's.