activerecord-cockroachdb-adapter
activerecord-cockroachdb-adapter copied to clipboard
[ActiveRecord 5.2 Test Failure] test/cases/scoping/default_scoping_test.rb
Failure:
DefaultScopingTest#test_joins_not_affected_by_scope_other_than_default_or_unscoped [/Users/alimi/repos/rails/activerecord/test/cases/scoping/default_scoping_test.rb:417]:
--- expected
+++ actual
@@ -1 +1 @@
-[#<Comment id: 9, post_id: 5, body: "Normal type", type: "Comment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SpecialComment id: 10, post_id: 5, body: "Special Type", type: "SpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<Comment id: 1, post_id: 1, body: "Thank you for the welcome", type: "Comment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<Comment id: 2, post_id: 1, body: "Thank you again for the welcome", type: "Comment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SpecialComment id: 3, post_id: 2, body: "Don't think too hard", type: "SpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<VerySpecialComment id: 5, post_id: 4, body: "Very Special type", type: "VerySpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SpecialComment id: 6, post_id: 4, body: "Special type", type: "SpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SpecialComment id: 7, post_id: 4, body: "Special type 2", type: "SpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<Comment id: 8, post_id: 4, body: "Normal type", type: "Comment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SpecialComment id: 11, post_id: 7, body: "go crazy", type: "SpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SubSpecialComment id: 12, post_id: 4, body: "Sub special comment", type: "SubSpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>]
+[#<Comment id: 1, post_id: 1, body: "Thank you for the welcome", type: "Comment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<Comment id: 9, post_id: 5, body: "Normal type", type: "Comment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SpecialComment id: 10, post_id: 5, body: "Special Type", type: "SpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<Comment id: 2, post_id: 1, body: "Thank you again for the welcome", type: "Comment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SpecialComment id: 3, post_id: 2, body: "Don't think too hard", type: "SpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<VerySpecialComment id: 5, post_id: 4, body: "Very Special type", type: "VerySpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SpecialComment id: 6, post_id: 4, body: "Special type", type: "SpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SpecialComment id: 7, post_id: 4, body: "Special type 2", type: "SpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<Comment id: 8, post_id: 4, body: "Normal type", type: "Comment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SpecialComment id: 11, post_id: 7, body: "go crazy", type: "SpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>, #<SubSpecialComment id: 12, post_id: 4, body: "Sub special comment", type: "SubSpecialComment", tags_count: 0, children_count: 0, parent_id: nil, author_type: nil, author_id: nil, resource_id: nil, resource_type: nil, developer_id: nil, updated_at: "2020-04-17 20:32:57", deleted_at: nil, comments: nil>]
bin/rails test Users/alimi/repos/rails/activerecord/test/cases/scoping/default_scoping_test.rb:410
See the Contributing Guide for instructions on running tests.
If the test isn't valid against CockroachDB
- Add a ruby file to
test/excludesthat matches the name of the test class if one doesn't already exist. For example to exclude a test fromActiveRecord::AdapterTest, createtest/excludes/ActiveRecord/AdapterTest.rb. - Add an exclude statement to the file with the name of the test to exclude and a description. For example to exclude
test_indexesfromActiveRecord::AdapterTest: https://github.com/cockroachdb/activerecord-cockroachdb-adapter/blob/c3cb637bd855b36bbf9e76b7947162054b95022e/test/excludes/ActiveRecord/AdapterTest.rb#L1 - Finally, if the test can run against CockroachDB with a few changes, add it to
test/cases. Everything from the ActiveRecord test suite will be available, so a lot of the excluded test can be copied over. Namespace the test under theCockroachDBmodule to avoid name collisions. Seetest/cases/adapter_test.rbfor an example.
See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48.