Should I expect all tests to pass?

Hello,

I'm trying to get into contributing for Rails and I'm trying to fix a
bug I've found and reported regarding migrations[1]. I started by
running all the MySQL tests but I've got three errors. Are these
errors expected? Should I expect all tests to pass at all times? If
so, is this something broken in rails or my system?

These are the errors:

$ rake test_mysql
(in /Users/pupeno/Projects/rails/rails/activerecord)
/Users/pupeno/.rvm/rubies/ruby-1.8.7-p174/bin/ruby -w -I"lib:test:test/
connections/native_mysql" "/Users/pupeno/.rvm/gems/ruby-1.8.7-
p174@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/cases/
active_schema_test_mysql.rb" "test/cases/adapter_test.rb" "test/cases/
aggregations_test.rb" "test/cases/ar_schema_test.rb" "test/cases/
associations/belongs_to_associations_test.rb" "test/cases/associations/
callbacks_test.rb" "test/cases/associations/
cascaded_eager_loading_test.rb" "test/cases/associations/
eager_load_includes_full_sti_class_test.rb" "test/cases/associations/
eager_load_nested_include_test.rb" "test/cases/associations/
eager_singularization_test.rb" "test/cases/associations/eager_test.rb"
"test/cases/associations/extension_test.rb" "test/cases/associations/
habtm_join_table_test.rb" "test/cases/associations/
has_and_belongs_to_many_associations_test.rb" "test/cases/associations/
has_many_associations_test.rb" "test/cases/associations/
has_many_through_associations_test.rb" "test/cases/associations/
has_one_associations_test.rb" "test/cases/associations/
has_one_through_associations_test.rb" "test/cases/associations/
inner_join_association_test.rb" "test/cases/associations/
inverse_associations_test.rb" "test/cases/associations/
join_model_test.rb" "test/cases/associations_test.rb" "test/cases/
attribute_methods_test.rb" "test/cases/autosave_association_test.rb"
"test/cases/base_test.rb" "test/cases/batches_test.rb" "test/cases/
binary_test.rb" "test/cases/calculations_test.rb" "test/cases/
callbacks_test.rb" "test/cases/column_alias_test.rb" "test/cases/
column_definition_test.rb" "test/cases/connection_pool_test.rb" "test/
cases/connection_test_mysql.rb" "test/cases/counter_cache_test.rb"
"test/cases/database_statements_test.rb" "test/cases/
date_time_test.rb" "test/cases/defaults_test.rb" "test/cases/
deprecated_finder_test.rb" "test/cases/dirty_test.rb" "test/cases/
finder_respond_to_test.rb" "test/cases/finder_test.rb" "test/cases/
fixtures_test.rb" "test/cases/i18n_test.rb" "test/cases/
inheritance_test.rb" "test/cases/invalid_date_test.rb" "test/cases/
json_serialization_test.rb" "test/cases/lifecycle_test.rb" "test/cases/
locking_test.rb" "test/cases/log_subscriber_test.rb" "test/cases/
method_scoping_test.rb" "test/cases/migration_test.rb" "test/cases/
mixin_test.rb" "test/cases/modules_test.rb" "test/cases/
multiple_db_test.rb" "test/cases/named_scope_test.rb" "test/cases/
nested_attributes_test.rb" "test/cases/pk_test.rb" "test/cases/
pooled_connections_test.rb" "test/cases/query_cache_test.rb" "test/
cases/readonly_test.rb" "test/cases/reflection_test.rb" "test/cases/
relations_test.rb" "test/cases/reload_models_test.rb" "test/cases/
reserved_word_test_mysql.rb" "test/cases/sanitize_test.rb" "test/cases/
schema_dumper_test.rb" "test/cases/serialization_test.rb" "test/cases/
timestamp_test.rb" "test/cases/transaction_callbacks_test.rb" "test/
cases/transactions_test.rb" "test/cases/unconnected_test.rb" "test/
cases/validations/association_validation_test.rb" "test/cases/
validations/i18n_generate_message_validation_test.rb" "test/cases/
validations/i18n_validation_test.rb" "test/cases/validations/
uniqueness_validation_test.rb" "test/cases/validations_test.rb" "test/
cases/xml_serialization_test.rb" "test/cases/
yaml_serialization_test.rb"
/Users/pupeno/.rvm/gems/ruby-1.8.7-p174@rails3/gems/bundler-0.9.26/lib/
bundler.rb:72: warning: instance variable @setup not initialized
/Users/pupeno/.rvm/gems/ruby-1.8.7-p174@rails3/gems/bundler-0.9.26/lib/
bundler/runtime.rb:145: warning: method redefined; discarding old path
/Users/pupeno/.rvm/gems/ruby-1.8.7-p174@rails3/bundler/gems/
arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/algebra/
relations/utilities/compound.rb:36: warning: method redefined;
discarding old engine
/Users/pupeno/.rvm/gems/ruby-1.8.7-p174@rails3/bundler/gems/
arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/algebra/
relations/operations/lock.rb:6: warning: method redefined; discarding
old initialize
/Users/pupeno/.rvm/gems/ruby-1.8.7-p174@rails3/bundler/gems/
arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/engines/
memory/relations/array.rb:9: warning: method redefined; discarding old
initialize
Using native MySQL
Loaded suite /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@global/gems/
rake-0.8.7/lib/rake/rake_test_loader
Started
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................/
Users/pupeno/.rvm/gems/ruby-1.8.7-p174@rails3/gems/i18n-0.4.1/lib/i18n/
core_ext/string/interpolate.rb:94: warning: too many arguments for
format string
......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................./
Users/pupeno/.rvm/gems/ruby-1.8.7-p174@rails3/gems/i18n-0.4.1/lib/i18n/
core_ext/string/interpolate.rb:94: warning: too many arguments for
format string
/Users/pupeno/.rvm/gems/ruby-1.8.7-p174@rails3/gems/i18n-0.4.1/lib/
i18n/core_ext/string/interpolate.rb:94: warning: too many arguments
for format string
.........................................................../Users/
pupeno/Projects/rails/rails/activerecord/lib/active_record/
connection_adapters/mysql_adapter.rb:572: warning: instance variable
errno not initialized
......................................................................................................................................................................................................................................................................................................................................................................................................................................................................E...F...F...............................
Finished in 325.986867 seconds.

  1) Error:
test_validate_case_insensitive_uniqueness(UniquenessValidationTest):
ActiveRecord::StatementInvalid: Mysql::Error: Illegal mix of
collations (latin1_swedish_ci,IMPLICIT) and
(utf8_general_ci,COERCIBLE) for operation '=': SELECT
`topics`.`id` FROM `topics` WHERE (LOWER(`topics`.`title`) =
LOWER('Я тоже уникальный!')) LIMIT 1
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
connection_adapters/abstract_adapter.rb:210:in `log'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
connection_adapters/mysql_adapter.rb:286:in
`execute_without_query_record'
    ./test/cases/helper.rb:40:in `execute'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
connection_adapters/mysql_adapter.rb:616:in `select'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
connection_adapters/abstract/database_statements.rb:7:in `select_all'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
connection_adapters/abstract/query_cache.rb:56:in `select_all'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
base.rb:431:in `find_by_sql'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
relation.rb:64:in `to_a'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
relation/finder_methods.rb:324:in `find_first'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
relation/finder_methods.rb:117:in `first'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
relation/finder_methods.rb:173:in `exists?'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
validations/uniqueness.rb:34:in `validate_each'
    /Users/pupeno/Projects/rails/rails/activemodel/lib/active_model/
validator.rb:151:in `validate'
    /Users/pupeno/Projects/rails/rails/activemodel/lib/active_model/
validator.rb:148:in `each'
    /Users/pupeno/Projects/rails/rails/activemodel/lib/active_model/
validator.rb:148:in `validate'
    /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/callbacks.rb:304:in `send'
    /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/callbacks.rb:304:in `_callback_before_4127'
    /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/callbacks.rb:413:in `_run_validate_callbacks'
    /Users/pupeno/Projects/rails/rails/activemodel/lib/active_model/
validations.rb:158:in `valid?'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
validations.rb:52:in `valid?'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
callbacks.rb:274:in `valid?'
    /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/callbacks.rb:417:in `_run_validation_callbacks'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
callbacks.rb:274:in `valid?'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
validations.rb:72:in `perform_validations'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
validations.rb:40:in `save'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
attribute_methods/dirty.rb:21:in `save'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
transactions.rb:235:in `save'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
transactions.rb:287:in `with_transaction_returning_status'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
connection_adapters/abstract/database_statements.rb:139:in
`transaction'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
transactions.rb:202:in `transaction'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
transactions.rb:285:in `with_transaction_returning_status'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
transactions.rb:235:in `save'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
transactions.rb:246:in `rollback_active_record_state!'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
transactions.rb:234:in `save'
    ./test/cases/validations/uniqueness_validation_test.rb:167:in
`test_validate_case_insensitive_uniqueness'
    /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
test_case.rb:55:in `with_kcode'
    ./test/cases/validations/uniqueness_validation_test.rb:165:in
`test_validate_case_insensitive_uniqueness'
    /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/testing/setup_and_teardown.rb:67:in `__send__'
    /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/testing/setup_and_teardown.rb:67:in `run'
    /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/callbacks.rb:417:in `_run_setup_callbacks'
    /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/testing/setup_and_teardown.rb:65:in `run'

  2) Failure:
test_validate_uniqueness(UniquenessValidationTest)
    [./test/cases/validations/uniqueness_validation_test.rb:53:in
`test_validate_uniqueness'
     /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/testing/setup_and_teardown.rb:67:in `__send__'
     /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/testing/setup_and_teardown.rb:67:in `run'
     /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/callbacks.rb:417:in `_run_setup_callbacks'
     /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/testing/setup_and_teardown.rb:65:in `run']:
Shouldn't be valid.
<false> is not true.

  3) Failure:
test_validate_uniqueness_with_limit_and_utf8(UniquenessValidationTest)
    [./test/cases/validations/uniqueness_validation_test.rb:251:in
`test_validate_uniqueness_with_limit_and_utf8'
     /Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/
test_case.rb:55:in `with_kcode'
     ./test/cases/validations/uniqueness_validation_test.rb:246:in
`test_validate_uniqueness_with_limit_and_utf8'
     /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/testing/setup_and_teardown.rb:67:in `__send__'
     /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/testing/setup_and_teardown.rb:67:in `run'
     /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/callbacks.rb:417:in `_run_setup_callbacks'
     /Users/pupeno/Projects/rails/rails/activesupport/lib/
active_support/testing/setup_and_teardown.rb:65:in `run']:
Created an event whose title, with limit taken into account, is not
unique.
<false> is not true.

2256 tests, 7096 assertions, 2 failures, 1 errors
rake aborted!
Command failed with status (1): [/Users/pupeno/.rvm/rubies/ruby-1.8.7-
p174/...]

(See full trace by running task with --trace)

Thanks.

[1] https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4809

This is a configuration problem with your mysql database. You'll need
to make sure your collation is set to utf8_unicode_ci or those tests
will fail.

Thank you Michael, that fixed it.