プロジェクト

全般

プロフィール

Vote #76446

未完了

A test fail when running it with PostgreSQL

Admin Redmine さんが約2年前に追加.

ステータス:
Needs feedback
優先度:
通常
担当者:
-
カテゴリ:
-
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
0
version_id:
0
issue_org_id:
20042
author_id:
88801
assigned_to_id:
0
comments:
4
status_id:
10
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
96
ステータス-->[Needs feedback]

説明

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


Minitest::Assertion: "Bug #16: Special chars: Öö" not found in "[#]"
test/unit/search_test.rb:159:in `test_search_should_be_case_insensitive_with_accented_characters'

journals

cannot reproduce.
http://www.redmine.org/builds/index.html
--------------------------------------------------------------------------------

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

<pre>
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
</pre>

<pre>
Environment:
Redmine version 3.0.3.stable
Ruby version 2.2.2-p95 (2015-04-13) [x86_64-darwin14]
Rails version 4.2.1
</pre>
--------------------------------------------------------------------------------
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).
<pre><code>
$ 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
</code></pre>

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
<pre><code>
$ 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
</code></pre>

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


related_issues

relates,Closed,19273,acts_as_searchable.rb only seems to be case insensitive if postgresql

表示するデータがありません

他の形式にエクスポート: Atom PDF

いいね!0