Skip to content
代码片段 群组 项目
未验证 提交 ab9588e6 编辑于 作者: Peter Leitzen's avatar Peter Leitzen 提交者: GitLab
浏览文件

Merge branch 'sh-order-dep-test-failure-audit-events' into 'master'

Fix order-dependent test when linting audit event factories

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/160362



Merged-by: default avatarPeter Leitzen <pleitzen@gitlab.com>
Approved-by: default avatarPeter Leitzen <pleitzen@gitlab.com>
Reviewed-by: default avatarPeter Leitzen <pleitzen@gitlab.com>
Co-authored-by: default avatarStan Hu <stanhu@gmail.com>
No related branches found
No related tags found
无相关合并请求
......@@ -88,31 +88,34 @@
end
end
trait :instance_event do
transient { instance_scope { Gitlab::Audit::InstanceScope.new } }
if Gitlab.ee?
trait :instance_event do
transient { instance_scope { Gitlab::Audit::InstanceScope.new } }
entity_type { Gitlab::Audit::InstanceScope.name }
entity_id { instance_scope.id }
entity_path { instance_scope.full_path }
target_details { instance_scope.name }
ip_address { IPAddr.new '127.0.0.1' }
details do
{
change: 'project_creation_level',
from: nil,
to: 'Developers + Maintainers',
author_name: user.name,
target_id: instance_scope.id,
target_type: Gitlab::Audit::InstanceScope.name,
target_details: instance_scope.name,
ip_address: '127.0.0.1',
entity_path: instance_scope.full_path
}
entity_type { Gitlab::Audit::InstanceScope.name }
entity_id { instance_scope.id }
entity_path { instance_scope.full_path }
target_details { instance_scope.name }
ip_address { IPAddr.new '127.0.0.1' }
details do
{
change: 'project_creation_level',
from: nil,
to: 'Developers + Maintainers',
author_name: user.name,
target_id: instance_scope.id,
target_type: Gitlab::Audit::InstanceScope.name,
target_details: instance_scope.name,
ip_address: '127.0.0.1',
entity_path: instance_scope.full_path
}
end
end
factory :instance_audit_event, traits: [:instance_event]
end
factory :project_audit_event, traits: [:project_event]
factory :group_audit_event, traits: [:group_event]
factory :instance_audit_event, traits: [:instance_event]
end
end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册