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
4b37c7bf
Commit
4b37c7bf
authored
Aug 28, 2020
by
Marius Bobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update group_name regular expression to match matrix builds
parent
b74ee551
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
app/models/commit_status.rb
app/models/commit_status.rb
+12
-1
spec/models/commit_status_spec.rb
spec/models/commit_status_spec.rb
+7
-1
No files found.
app/models/commit_status.rb
View file @
4b37c7bf
...
@@ -198,8 +198,19 @@ class CommitStatus < ApplicationRecord
...
@@ -198,8 +198,19 @@ class CommitStatus < ApplicationRecord
will_save_change_to_status?
will_save_change_to_status?
end
end
# Extracts common job name for matrix and parallel builds:
# 'rspec:linux: [aws, max memory]' => 'rspec:linux'
# 'rspec:linux: 1/10' => 'rspec:linux'
#
def
group_name
def
group_name
name
.
to_s
.
gsub
(
%r{
\d
+[
\s
:/
\\
]+
\d
+
\s
*}
,
''
).
strip
if
Gitlab
::
Ci
::
Features
.
new_matrix_job_names_enabled?
matches
=
name
.
to_s
.
match
(
/\A(.*?): \[+(.*, )+(.*)\]\z/
)
group_name
=
matches
.
to_a
[
1
]
||
name
else
group_name
=
name
end
group_name
.
to_s
.
gsub
(
%r{
\d
+[
\s
:/
\\
]+
\d
+
\s
*}
,
''
).
strip
end
end
def
failed_but_allowed?
def
failed_but_allowed?
...
...
spec/models/commit_status_spec.rb
View file @
4b37c7bf
...
@@ -510,7 +510,13 @@ RSpec.describe CommitStatus do
...
@@ -510,7 +510,13 @@ RSpec.describe CommitStatus do
'rspec:windows 0 : / 1'
=>
'rspec:windows'
,
'rspec:windows 0 : / 1'
=>
'rspec:windows'
,
'rspec:windows 0 : / 1 name'
=>
'rspec:windows name'
,
'rspec:windows 0 : / 1 name'
=>
'rspec:windows name'
,
'0 1 name ruby'
=>
'name ruby'
,
'0 1 name ruby'
=>
'name ruby'
,
'0 :/ 1 name ruby'
=>
'name ruby'
'0 :/ 1 name ruby'
=>
'name ruby'
,
'rspec: [aws]'
=>
'rspec: [aws]'
,
'rspec: [aws] 0/1'
=>
'rspec: [aws]'
,
'rspec: [aws, max memory]'
=>
'rspec'
,
'rspec:linux: [aws, max memory]'
=>
'rspec:linux'
,
'rspec: [inception: [something, other thing], value]'
=>
'rspec'
,
'rspec:windows 0/1: [name, other]'
=>
'rspec:windows'
}
}
tests
.
each
do
|
name
,
group_name
|
tests
.
each
do
|
name
,
group_name
|
...
...
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