Patch #35975

UserTest#test_remove_custom_field_references_upon_destroy test fails

Added by Yuichi HARADA 10 days ago. Updated 10 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Code cleanup/refactoring
Target version:-

Description

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]:
#<Proc:0x00007ff4ddd7bdb8 test/unit/user_test.rb:1340 (lambda)> 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.

35975.patch Magnifier (475 Bytes) Yuichi HARADA, 2021-10-11 07:48

History

#1 Updated by Yuichi HARADA 10 days ago

I added fixtures and confirmed that the test was successful.

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

Also available in: Atom PDF