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
604dbc21
Commit
604dbc21
authored
Nov 05, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rspec failures
parent
4a09690e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+2
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+5
-0
No files found.
app/models/ci/pipeline.rb
View file @
604dbc21
...
...
@@ -198,12 +198,14 @@ module Ci
def
self
.
newest_first
(
ref:
nil
,
limit:
100
)
relation
=
order
(
id: :desc
)
relation
=
relation
.
where
(
ref:
ref
)
if
ref
if
limit
ids
=
relation
.
limit
(
limit
).
select
(
:id
)
# MySQL does not support limit in subquery
ids
=
ids
.
pluck
(
:id
)
if
Gitlab
::
Database
.
mysql?
relation
=
relation
.
where
(
id:
ids
)
end
relation
end
...
...
spec/models/ci/pipeline_spec.rb
View file @
604dbc21
...
...
@@ -1052,6 +1052,11 @@ describe Ci::Pipeline, :mailer do
expect
(
described_class
.
newest_first
.
pluck
(
:status
))
.
to
eq
(
%w[skipped failed success canceled]
)
end
it
'searches limited backlog'
do
expect
(
described_class
.
newest_first
(
limit:
1
).
pluck
(
:status
))
.
to
eq
(
%w[skipped]
)
end
end
describe
'.latest_status'
do
...
...
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