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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
b964c6c5
Commit
b964c6c5
authored
Sep 14, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add grouping tests
parent
8759770c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
app/models/commit_status.rb
app/models/commit_status.rb
+5
-1
spec/models/commit_status_spec.rb
spec/models/commit_status_spec.rb
+27
-0
No files found.
app/models/commit_status.rb
View file @
b964c6c5
...
@@ -96,7 +96,7 @@ class CommitStatus < ActiveRecord::Base
...
@@ -96,7 +96,7 @@ class CommitStatus < ActiveRecord::Base
end
end
def
group_name
def
group_name
name
.
gsub
(
/\d+[\s:
]+\d+\s*/
,
''
)
name
.
gsub
(
/\d+[\s:
\/\\]+\d+\s*/
,
''
).
strip
end
end
def
self
.
stages
def
self
.
stages
...
@@ -117,6 +117,10 @@ class CommitStatus < ActiveRecord::Base
...
@@ -117,6 +117,10 @@ class CommitStatus < ActiveRecord::Base
allow_failure?
&&
(
failed?
||
canceled?
)
allow_failure?
&&
(
failed?
||
canceled?
)
end
end
def
playable?
false
end
def
duration
def
duration
calculate_duration
calculate_duration
end
end
...
...
spec/models/commit_status_spec.rb
View file @
b964c6c5
...
@@ -223,4 +223,31 @@ describe CommitStatus, models: true do
...
@@ -223,4 +223,31 @@ describe CommitStatus, models: true do
expect
(
commit_status
.
commit
).
to
eq
project
.
commit
expect
(
commit_status
.
commit
).
to
eq
project
.
commit
end
end
end
end
describe
'#group_name'
do
subject
{
commit_status
.
group_name
}
tests
=
{
'rspec:windows'
=>
'rspec:windows'
,
'rspec:windows 0'
=>
'rspec:windows 0'
,
'rspec:windows 0 test'
=>
'rspec:windows 0 test'
,
'rspec:windows 0 1'
=>
'rspec:windows'
,
'rspec:windows 0 1 name'
=>
'rspec:windows name'
,
'rspec:windows 0/1'
=>
'rspec:windows'
,
'rspec:windows 0/1 name'
=>
'rspec:windows name'
,
'rspec:windows 0:1'
=>
'rspec:windows'
,
'rspec:windows 0:1 name'
=>
'rspec:windows name'
,
'rspec:windows 10000 20000'
=>
'rspec:windows'
,
'rspec:windows 0 : / 1'
=>
'rspec:windows'
,
'rspec:windows 0 : / 1 name'
=>
'rspec:windows name'
,
}
tests
.
each
do
|
name
,
group_name
|
it
"'
#{
name
}
' puts in '
#{
group_name
}
'"
do
commit_status
.
name
=
name
is_expected
.
to
eq
(
group_name
)
end
end
end
end
end
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