プロジェクト

全般

プロフィール

Vote #81665

完了

Add missing fixtures to UserTest

Admin Redmine さんが約4年前に追加. 約4年前に更新.

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

0%

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

説明

I confirmed https://www.redmine.org/builds/logs/build_4.1-stable_sqlite3_ruby-2.6_173.html and the test failed. When I executed the tests in my local environment with the same seed value (--seed 8964), the following test failed.

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

% RAILS_ENV=test bundle exec rake test TESTOPTS="--seed 8964"
(Test LDAP server not configured)
Bazaar non ASCII output test cannot run on this environment.
Encoding.locale_charmap: UTF-8
Skipping LDAP tests.
Run options: --seed 8964

# Running:

........................................................................................................................................F

Failure:
UserTest#test_remove_custom_field_references_upon_destroy [test/unit/user_test.rb:1340]:
# didn't change by -3.
Expected: 4
  Actual: 5


rails test test/unit/user_test.rb:1316

............................................

Finished in 513.679501s, 10.3197 runs/s, 47.3311 assertions/s.
5301 runs, 24313 assertions, 1 failures, 0 errors, 8 skips

You have skipped tests. Run with --verbose for details.

journals

I added fixtures and confirmed that the test was successful.

<pre><code class="diff">
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index 92a492e9be..3d1d8387dd 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -29,7 +29,8 @@ class UserTest < ActiveSupport::TestCase
:groups_users,
:enabled_modules,
:tokens,
- :user_preferences
+ :user_preferences,
+ :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values

include Redmine::I18n

</code></pre>
--------------------------------------------------------------------------------
Confirmed the issue.

<pre>
$ RAILS_ENV=test bin/rake db:reset
Dropped database 'db/test.sqlite3'
Created database 'db/test.sqlite3'
$ ruby test/unit/user_test.rb
Skipping LDAP tests.
Run options: --seed 10475

# Running:

...............................................................................................................F

Failure:
UserTest#test_remove_custom_field_references_upon_destroy [test/unit/user_test.rb:1340]:
#<Proc:0x00007f83d97a4450 test/unit/user_test.rb:1340 (lambda)> didn't change by -3.
Expected: 0
Actual: 1

rails test test/unit/user_test.rb:1316
</pre>
--------------------------------------------------------------------------------
Committed the patch. Thank you.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

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

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

いいね!0
いいね!0