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
Boxiang Sun
gitlab-ce
Commits
8b47980e
Commit
8b47980e
authored
May 04, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up "when redis had an outage" context in runner spec
parent
e1ad8ca6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
15 deletions
+37
-15
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+37
-15
No files found.
spec/requests/api/runner_spec.rb
View file @
8b47980e
...
@@ -867,29 +867,51 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
...
@@ -867,29 +867,51 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
end
end
end
end
context
'when redis had an outage'
do
context
'when trace is patched'
do
it
"recovers"
do
before
do
# GitLab-Runner patchs
patch_the_trace
patch_the_trace
end
it
'has valid trace'
do
expect
(
response
.
status
).
to
eq
(
202
)
expect
(
job
.
reload
.
trace
.
raw
).
to
eq
'BUILD TRACE appended appended'
expect
(
job
.
reload
.
trace
.
raw
).
to
eq
'BUILD TRACE appended appended'
end
# GitLab-Rails encounters an outage on Redis
context
'when redis data are flushed'
do
before
do
redis_shared_state_cleanup!
redis_shared_state_cleanup!
end
it
'has empty trace'
do
expect
(
job
.
reload
.
trace
.
raw
).
to
eq
''
expect
(
job
.
reload
.
trace
.
raw
).
to
eq
''
end
# GitLab-Runner patchs
context
'when we perform partial patch'
do
before
do
patch_the_trace
(
'hello'
,
headers
.
merge
({
'Content-Range'
=>
"28-32"
}))
patch_the_trace
(
'hello'
,
headers
.
merge
({
'Content-Range'
=>
"28-32"
}))
expect
(
response
.
status
).
to
eq
202
end
it
'returns an error'
do
expect
(
response
.
status
).
to
eq
(
202
)
expect
(
response
.
header
).
to
have_key
'Range'
expect
(
response
.
header
).
to
have_key
'Range'
expect
(
response
.
header
[
'Range'
]).
to
eq
'0-0'
expect
(
response
.
header
[
'Range'
]).
to
eq
'0-0'
expect
(
job
.
reload
.
trace
.
raw
).
to
eq
''
expect
(
job
.
reload
.
trace
.
raw
).
to
eq
''
end
end
# GitLab-Runner re-patchs
context
'when we resend full trace'
do
before
do
patch_the_trace
(
'BUILD TRACE appended appended hello'
)
patch_the_trace
(
'BUILD TRACE appended appended hello'
)
end
it
'succeeds with updating trace'
do
expect
(
response
.
status
).
to
eq
(
202
)
expect
(
job
.
reload
.
trace
.
raw
).
to
eq
'BUILD TRACE appended appended hello'
expect
(
job
.
reload
.
trace
.
raw
).
to
eq
'BUILD TRACE appended appended hello'
end
end
end
end
end
end
end
end
context
'when Runner makes a force-patch'
do
context
'when Runner makes a force-patch'
do
before
do
before
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