Skip to content

Fix unittest about user params validation

路志远请求将fix-pipeline-888779合并到main-jh

What does this MR do and why?

Fix pipeline failed job: https://jihulab.com/gitlab-cn/gitlab/-/jobs/6012104

Error log
RSpec::Retry: 2nd try ./jh/spec/support/shared_examples/models/content_validation_shared_examples.rb:62
Failures:
  1) User validations behaves like content validation validations skype  untrust is expected not to allow :skype to be ‹"你好 sensitive"›
     Failure/Error: example.run
       After setting :skype to ‹"你好 sensitive"›, the matcher expected the User
       to be invalid, but it was valid instead.
     Shared Example Group: "content validation" called from ./jh/spec/models/jh/user_spec.rb:8
     # ./jh/spec/support/shared_examples/models/content_validation_shared_examples.rb:62:in `block (5 levels) in <main>'
     # ./spec/spec_helper.rb:415:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:407:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:403:in `block (3 levels) in <top (required)>'
     # ./lib/gitlab/application_context.rb:59:in `with_raw_context'
     # ./spec/spec_helper.rb:403:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:239:in `block (2 levels) in <top (required)>'
     # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
     # ./spec/support/flaky_tests.rb:27:in `block (2 levels) in <main>'
     # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
     # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
     # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
     # ./jh/spec/spec_helper.rb:30:in `block (2 levels) in <main>'

Why

Upstream 将 User 的一些属性迁移到了 UserDetail 中,使得 JH 中 User 关于这些属性的单元测试找不到 [attr]_changed? 方法,测试失败。

Upstream MR: Delegate profile fields to user details (2023-01-05 00:53 Merged)


cc @mtan-gitlab-cn @qt

路志远 编辑于

合并请求报告

加载中