Defect #20042

A test fail when running it with PostgreSQL

Added by Vincent Robert almost 6 years ago. Updated 4 months ago.

Status:Needs feedbackStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution:Cant reproduce Affected version:3.0.3

Description

When running the test suite with PostgreSQL, this test fails:

Minitest::Assertion: "Bug #16: Special chars: Öö" not found in "[#<Issue id: 15, tracker_id: 1, project_id: 1, subject: "Special chars: ÖÖ", description: nil, due_date: nil, category_id: nil, status_id: 1, assigned_to_id: nil, priority_id: 5, fixed_version_id: nil, author_id: 2, lock_version: 0, created_on: "2015-04-27 10:19:13", updated_on: "2015-04-27 10:19:13", start_date: nil, done_ratio: 0, estimated_hours: nil, parent_id: nil, root_id: 15, lft: 1, rgt: 2, is_private: false, closed_on: nil>]" 
test/unit/search_test.rb:159:in `test_search_should_be_case_insensitive_with_accented_characters'

Related issues

Related to Redmine - Defect #19273: acts_as_searchable.rb only seems to be case insensitive i... Closed

History

#1 Updated by Toshi MARUYAMA almost 6 years ago

  • Status changed from New to Needs feedback
  • Resolution set to Cant reproduce

#2 Updated by Toshi MARUYAMA almost 6 years ago

  • Related to Defect #19273: acts_as_searchable.rb only seems to be case insensitive if postgresql added

#3 Updated by Vincent Robert almost 6 years ago

Using PostgreSQL 9.3.1, with a fresh install on Mac OS X, without any plugin, I get this failure:

redmine-3.0.3: ruby test/unit/search_test.rb
Run options: --seed 51093

# Running:

.......F.

Finished in 1.519564s, 5.9228 runs/s, 21.0587 assertions/s.

  1) Failure:
SearchTest#test_search_should_be_case_insensitive_with_accented_characters [test/unit/search_test.rb:159]:
"Bug #18: Special chars: Öö" not found in "[#<Issue id: 17, tracker_id: 1, project_id: 1, subject: "Special chars: ÖÖ", description: nil, due_date: nil, category_id: nil, status_id: 1, assigned_to_id: nil, priority_id: 5, fixed_version_id: nil, author_id: 2, lock_version: 0, created_on: "2015-06-15 07:51:24", updated_on: "2015-06-15 07:51:24", start_date: nil, done_ratio: 0, estimated_hours: nil, parent_id: nil, root_id: 17, lft: 1, rgt: 2, is_private: false, closed_on: nil>]" 

9 runs, 32 assertions, 1 failures, 0 errors, 0 skips
Environment:
  Redmine version                3.0.3.stable
  Ruby version                   2.2.2-p95 (2015-04-13) [x86_64-darwin14]
  Rails version                  4.2.1

#4 Updated by Ko Nagase 4 months ago

Well, I encountered the same error on the latest master (trunk, 4.1+) on macOS Mojave (10.14.6) and PostgreSQL 13.1 (from Homebrew).


$ bundle exec rails test test/unit/search_test.rb:153
Run options: --seed 50546

# Running:

F

Failure:
SearchTest#test_search_should_be_case_insensitive_with_accented_characters [/path/to/redmine/test/unit/search_test.rb:159]:
"Bug #16: Special chars: Öö" not found in "[#<Issue id: 15, tracker_id: 1, project_id: 1, subject: "Special chars: ÖÖ", description: nil, due_date: nil, category_id: nil, status_id: 1, assigned_to_id: nil, priority_id: 5, fixed_version_id: nil, author_id: 2, lock_version: 0, created_on: "2021-01-18 07:49:29", updated_on: "2021-01-18 07:49:29", start_date: nil, done_ratio: 0, estimated_hours: nil, parent_id: nil, root_id: 15, lft: 1, rgt: 2, is_private: false, closed_on: nil>]" 

bin/rails test test/unit/search_test.rb:153

Finished in 0.533460s, 1.8746 runs/s, 3.7491 assertions/s.
1 runs, 2 assertions, 1 failures, 0 errors, 0 skip

But, after enabling unaccent extension on PostgreSQL, then the test was passed.
https://stackoverflow.com/questions/11005036/does-postgresql-support-accent-insensitive-collations/11007216#11007216


$ psql -U postgres redmine_test
# CREATE EXTENSION unaccent;
# \q
$ bundle exec rails test test/unit/search_test.rb:153
Run options: --seed 21594

# Running:

.

Finished in 0.535496s, 1.8674 runs/s, 3.7349 assertions/s.
1 runs, 2 assertions, 0 failures, 0 errors, 0 skips

So, I think that this is PostgreSQL environment related issue.

Also available in: Atom PDF