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

[ActiveRecord 5.2 Test Failure] test/cases/adapters/postgresql/collation_test.rb #104

Closed
alimi opened this issue Apr 17, 2020 · 0 comments
Closed

Comments

@alimi
Copy link
Contributor

alimi commented Apr 17, 2020

All tests fail in the setup trying to set collate to C.

ActiveRecord::StatementInvalid: PG::SyntaxError: ERROR:  at or near ",": syntax error: invalid locale C: language: tag is not well-formed
DETAIL:  source SQL:
CREATE TABLE "postgresql_collations" ("id" bigserial primary key, "string_c" character varying COLLATE "C", "text_posix" text COLLATE "POSIX")

https://www.postgresql.org/docs/current/collation.html
https://www.cockroachlabs.com/docs/v19.2/collate.html

See the Contributing Guide for instructions on running tests.

If the test isn't valid against CockroachDB

  1. Add a ruby file to test/excludes that matches the name of the test class if one doesn't already exist. For example to exclude a test from ActiveRecord::AdapterTest, create test/excludes/ActiveRecord/AdapterTest.rb.
  2. Add an exclude statement to the file with the name of the test to exclude and a description. For example to exclude test_indexes from ActiveRecord::AdapterTest:
    exclude :test_indexes, "Rails transactional tests are being used while making schema changes. See https://www.cockroachlabs.com/docs/stable/online-schema-changes.html#limited-support-for-schema-changes-within-transactions."
  3. 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 the CockroachDB module to avoid name collisions. See test/cases/adapter_test.rb for an example.

See #48.

@BuonOmo BuonOmo closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants