Skip to content
代码片段 群组 项目
提交 b2bc1bab 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Merge branch '393364-smarter_detection_under_pages_folder' into 'master'

Skip JS "pages" folder when detecting feature tests

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



Merged-by: default avatarStan Hu <stanhu@gmail.com>
Approved-by: default avatarAlina Mihaila <amihaila@gitlab.com>
Approved-by: default avatarStan Hu <stanhu@gmail.com>
Co-authored-by: default avatarddieulivol <ddieulivol@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -129,6 +129,20 @@ ...@@ -129,6 +129,20 @@
it 'returns a singularized keyword based on the first folder the file is in' do it 'returns a singularized keyword based on the first folder the file is in' do
expect(subject).to eq(%w[board query]) expect(subject).to eq(%w[board query])
end end
context 'when the files are under the pages folder' do
let(:js_files) do
%w[
app/assets/javascripts/pages/boards/issue_board_filters.js
ee/app/assets/javascripts/pages2/queries/epic_due_date.query.graphql
ee/app/assets/javascripts/queries/epic_due_date.query.graphql
]
end
it 'captures the second folder' do
expect(subject).to eq(%w[board pages2 query])
end
end
end end
describe '#system_specs_for_edition' do describe '#system_specs_for_edition' do
......
...@@ -18,6 +18,7 @@ def initialize(js_base_folder: 'app/assets/javascripts', system_specs_base_folde ...@@ -18,6 +18,7 @@ def initialize(js_base_folder: 'app/assets/javascripts', system_specs_base_folde
@first_js_folder_extract_regexp = %r{ @first_js_folder_extract_regexp = %r{
(?:.*/)? # Skips the GitLab edition (e.g. ee/, jh/) (?:.*/)? # Skips the GitLab edition (e.g. ee/, jh/)
#{@js_base_folder}/ # Most likely app/assets/javascripts/ #{@js_base_folder}/ # Most likely app/assets/javascripts/
(?:pages/)? # If under a pages folder, we capture the following folder
([\w-]*) # Captures the first folder ([\w-]*) # Captures the first folder
}x }x
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册