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
f9b821f0
Commit
f9b821f0
authored
Jun 02, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs for exclusive lease
parent
5a1ee0c3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
+20
-11
app/services/concerns/exclusive_lease_guard.rb
app/services/concerns/exclusive_lease_guard.rb
+1
-1
spec/support/shared_examples/ci_trace_shared_examples.rb
spec/support/shared_examples/ci_trace_shared_examples.rb
+19
-10
No files found.
app/services/concerns/exclusive_lease_guard.rb
View file @
f9b821f0
...
@@ -47,6 +47,6 @@ module ExclusiveLeaseGuard
...
@@ -47,6 +47,6 @@ module ExclusiveLeaseGuard
end
end
def
log_error
(
message
,
extra_args
=
{})
def
log_error
(
message
,
extra_args
=
{})
logger
.
error
(
message
)
Rails
.
logger
.
error
(
message
)
end
end
end
end
spec/support/shared_examples/ci_trace_shared_examples.rb
View file @
f9b821f0
...
@@ -234,9 +234,15 @@ shared_examples_for 'common trace features' do
...
@@ -234,9 +234,15 @@ shared_examples_for 'common trace features' do
context
'when build status is success'
do
context
'when build status is success'
do
let!
(
:build
)
{
create
(
:ci_build
,
:success
,
:trace_live
)
}
let!
(
:build
)
{
create
(
:ci_build
,
:success
,
:trace_live
)
}
it
'archives a trace'
do
it
'does not have an archived trace yet'
do
expect
(
build
.
job_artifacts_trace
).
to
be_nil
end
context
'when archives'
do
it
'has an archived trace'
do
subject
subject
build
.
reload
expect
(
build
.
job_artifacts_trace
).
to
be_exist
expect
(
build
.
job_artifacts_trace
).
to
be_exist
end
end
...
@@ -245,13 +251,16 @@ shared_examples_for 'common trace features' do
...
@@ -245,13 +251,16 @@ shared_examples_for 'common trace features' do
Gitlab
::
ExclusiveLease
.
new
(
"trace:archive:
#{
trace
.
job
.
id
}
"
,
timeout:
1
.
hour
).
try_obtain
Gitlab
::
ExclusiveLease
.
new
(
"trace:archive:
#{
trace
.
job
.
id
}
"
,
timeout:
1
.
hour
).
try_obtain
end
end
it
'prevents multiple archiving'
do
it
'prevents to archive concurently'
do
subject
build
.
reload
build
.
reload
expect
(
build
.
job_artifacts_trace
).
to
be_nil
expect
(
build
.
job_artifacts_trace
).
to
be_nil
end
end
end
end
end
end
end
end
end
end
end
shared_examples_for
'trace with disabled live trace feature'
do
shared_examples_for
'trace with disabled live trace feature'
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