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
32ee2a49
Commit
32ee2a49
authored
Apr 02, 2018
by
Jacopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor review changes
parent
3097215d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
17 deletions
+14
-17
lib/gitlab/ci/trace/stream.rb
lib/gitlab/ci/trace/stream.rb
+3
-3
lib/gitlab/optimistic_locking.rb
lib/gitlab/optimistic_locking.rb
+8
-11
qa/qa/page/project/pipeline/show.rb
qa/qa/page/project/pipeline/show.rb
+2
-2
spec/lib/gitlab/ci/trace_spec.rb
spec/lib/gitlab/ci/trace_spec.rb
+1
-1
No files found.
lib/gitlab/ci/trace/stream.rb
View file @
32ee2a49
...
@@ -77,7 +77,7 @@ module Gitlab
...
@@ -77,7 +77,7 @@ module Gitlab
match
=
""
match
=
""
matched
=
reverse_line
do
|
line
|
reverse_line
do
|
line
|
line
.
chomp!
line
.
chomp!
matches
=
regex
.
scan
(
line
)
matches
=
regex
.
scan
(
line
)
next
unless
matches
.
is_a?
(
Array
)
next
unless
matches
.
is_a?
(
Array
)
...
@@ -85,10 +85,10 @@ module Gitlab
...
@@ -85,10 +85,10 @@ module Gitlab
match
=
matches
.
flatten
.
last
match
=
matches
.
flatten
.
last
coverage
=
match
.
gsub
(
/\d+(\.\d+)?/
).
first
coverage
=
match
.
gsub
(
/\d+(\.\d+)?/
).
first
break
coverage
if
coverage
.
present?
return
coverage
if
coverage
.
present?
# rubocop:disable Cop/AvoidReturnFromBlocks
end
end
matched
.
presence
nil
rescue
rescue
# if bad regex or something goes wrong we dont want to interrupt transition
# if bad regex or something goes wrong we dont want to interrupt transition
# so we just silently ignore error for now
# so we just silently ignore error for now
...
...
lib/gitlab/optimistic_locking.rb
View file @
32ee2a49
...
@@ -3,18 +3,15 @@ module Gitlab
...
@@ -3,18 +3,15 @@ module Gitlab
module_function
module_function
def
retry_lock
(
subject
,
retries
=
100
,
&
block
)
def
retry_lock
(
subject
,
retries
=
100
,
&
block
)
loop
do
ActiveRecord
::
Base
.
transaction
do
begin
yield
(
subject
)
ActiveRecord
::
Base
.
transaction
do
return
yield
(
subject
)
# rubocop:disable Cop/AvoidReturnFromBlocks
end
rescue
ActiveRecord
::
StaleObjectError
retries
-=
1
raise
unless
retries
>=
0
subject
.
reload
end
end
end
rescue
ActiveRecord
::
StaleObjectError
retries
-=
1
raise
unless
retries
>=
0
subject
.
reload
retry
end
end
alias_method
:retry_optimistic_lock
,
:retry_lock
alias_method
:retry_optimistic_lock
,
:retry_lock
...
...
qa/qa/page/project/pipeline/show.rb
View file @
32ee2a49
...
@@ -20,14 +20,14 @@ module QA::Page
...
@@ -20,14 +20,14 @@ module QA::Page
def
running?
def
running?
within
(
'.ci-header-container'
)
do
within
(
'.ci-header-container'
)
do
break
page
.
has_content?
(
'running'
)
page
.
has_content?
(
'running'
)
end
end
end
end
def
has_build?
(
name
,
status: :success
)
def
has_build?
(
name
,
status: :success
)
within
(
'.pipeline-graph'
)
do
within
(
'.pipeline-graph'
)
do
within
(
'.ci-job-component'
,
text:
name
)
do
within
(
'.ci-job-component'
,
text:
name
)
do
return
has_selector?
(
".ci-status-icon-
#{
status
}
"
)
# rubocop:disable Cop/AvoidReturnFromBlocks
has_selector?
(
".ci-status-icon-
#{
status
}
"
)
end
end
end
end
end
end
...
...
spec/lib/gitlab/ci/trace_spec.rb
View file @
32ee2a49
...
@@ -458,7 +458,7 @@ describe Gitlab::Ci::Trace do
...
@@ -458,7 +458,7 @@ describe Gitlab::Ci::Trace do
context
'when job does not have trace artifact'
do
context
'when job does not have trace artifact'
do
context
'when trace file stored in default path'
do
context
'when trace file stored in default path'
do
let!
(
:build
)
{
create
(
:ci_build
,
:success
,
:trace_live
)
}
let!
(
:build
)
{
create
(
:ci_build
,
:success
,
:trace_live
)
}
let!
(
:src_path
)
{
trace
.
read
{
|
s
|
break
s
.
path
}
}
let!
(
:src_path
)
{
trace
.
read
{
|
s
|
s
.
path
}
}
let!
(
:src_checksum
)
{
Digest
::
SHA256
.
file
(
src_path
).
hexdigest
}
let!
(
:src_checksum
)
{
Digest
::
SHA256
.
file
(
src_path
).
hexdigest
}
it_behaves_like
'archive trace file'
it_behaves_like
'archive trace file'
...
...
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