Project

General

Profile

Actions

Patch #35975

closed

Add missing fixtures to UserTest

Added by Yuichi HARADA about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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.

Files

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

Updated by Yuichi HARADA about 3 years 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

Actions #2

Updated by Go MAEDA about 3 years ago

  • Target version set to 5.0.0

Confirmed the issue.

$ 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
Actions #3

Updated by Go MAEDA about 3 years ago

  • Subject changed from UserTest#test_remove_custom_field_references_upon_destroy test fails to Add missing fixtures to UserTest
  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch. Thank you.

Actions

Also available in: Atom PDF