Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1960fb7c
Commit
1960fb7c
authored
Jun 15, 2020
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fail rspec foss-impact job with too many test files
It would recommend to add RUN AS-IF-FOSS to the merge request.
parent
21ddfabe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
.gitlab/ci/rules.gitlab-ci.yml
.gitlab/ci/rules.gitlab-ci.yml
+2
-0
scripts/rspec_helpers.sh
scripts/rspec_helpers.sh
+12
-0
No files found.
.gitlab/ci/rules.gitlab-ci.yml
View file @
1960fb7c
...
...
@@ -422,6 +422,8 @@
rules
:
-
<<
:
*if-not-ee
when
:
never
-
<<
:
*if-merge-request-title-as-if-foss
when
:
never
-
<<
:
*if-security-merge-request
changes
:
*code-backstage-patterns
-
<<
:
*if-dot-com-gitlab-org-merge-request
...
...
scripts/rspec_helpers.sh
View file @
1960fb7c
...
...
@@ -112,9 +112,21 @@ function rspec_paralellized_job() {
}
function
rspec_matched_tests
()
{
local
test_file_count_threshold
=
20
local
matching_tests_file
=
${
1
}
local
rspec_opts
=
${
2
}
local
test_files
=
"
$(
cat
"
${
matching_tests_file
}
"
)
"
local
test_file_count
=
$(
wc
-w
"
${
matching_tests_file
}
"
|
awk
{
'print $1'
}
)
if
[[
"
${
test_file_count
}
"
-gt
"
${
test_file_count_threshold
}
"
]]
;
then
echo
"There are more than
${
test_file_count_threshold
}
FOSS test files matched,"
echo
"which would take too long to run in this job."
echo
"To reduce the likelihood of breaking FOSS pipelines,"
echo
"please add [RUN AS-IF-FOSS] to the MR title and restart the pipeline."
echo
"This would run all as-if-foss jobs in this merge request"
echo
"and remove this job from the pipeline."
exit
1
fi
if
[[
-n
$test_files
]]
;
then
rspec_simple_job
"
${
rspec_opts
}
${
test_files
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment