プロジェクト

全般

プロフィール

Vote #80278

完了

IssueCustomFieldTest randomly fails

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

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

0%

予定工数:
category_id:
30
version_id:
127
issue_org_id:
31967
author_id:
362529
assigned_to_id:
332
comments:
2
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

@IssueCustomFieldTest@ fails in the following procedure.

$ RAILS_ENV=test bundle exec rake db:migrate:reset

$ RAILS_ENV=test bundle exec rake test TEST=test/unit/issue_custom_field_test.rb
Run options: --seed 7200

# Running:

E

Error:
IssueCustomFieldTest#test_changing_visible_to_true_should_clear_roles:
ActiveRecord::RecordNotFound: Couldn't find IssueCategory with 'id'=1
    test/unit/issue_custom_field_test.rb:29:in `setup'


bin/rails test test/unit/issue_custom_field_test.rb:41

E

Error:
IssueCustomFieldTest#test_custom_field_with_visible_set_to_false_should_validate_roles:
ActiveRecord::RecordNotFound: Couldn't find IssueCategory with 'id'=1
    test/unit/issue_custom_field_test.rb:29:in `setup'


bin/rails test test/unit/issue_custom_field_test.rb:32



Finished in 0.015735s, 127.1052 runs/s, 0.0000 assertions/s.
2 runs, 0 assertions, 0 failures, 2 errors, 0 skips

Solved by the following patch.


diff --git a/test/unit/issue_custom_field_test.rb b/test/unit/issue_custom_field_test.rb
index f6e6d4863..321dceb43 100644
--- a/test/unit/issue_custom_field_test.rb
+++ b/test/unit/issue_custom_field_test.rb
@@ -26,7 +26,6 @@ class IssueCustomFieldTest < ActiveSupport::TestCase

   def setup
     User.current = nil
-    @category = IssueCategory.find(1)
   end

   def test_custom_field_with_visible_set_to_false_should_validate_roles

journals

The instance variable @category has never used in issue_custom_field_test.rb. Probably the line was mistakenly added in r17761.

Setting the target version to 4.1.0.
--------------------------------------------------------------------------------
Committed the fix. Thanks.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン4.1.0_127 にセット

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

いいね!0
いいね!0