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
d3814ad6
Commit
d3814ad6
authored
Jul 24, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds some specs for stage optimistic locking
parent
0aefb516
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
spec/lib/gitlab/import_export/safe_model_attributes.yml
spec/lib/gitlab/import_export/safe_model_attributes.yml
+1
-0
spec/models/ci/stage_spec.rb
spec/models/ci/stage_spec.rb
+19
-0
spec/services/ci/retry_build_service_spec.rb
spec/services/ci/retry_build_service_spec.rb
+1
-1
No files found.
spec/lib/gitlab/import_export/safe_model_attributes.yml
View file @
d3814ad6
...
...
@@ -220,6 +220,7 @@ Ci::Stage:
-
id
-
name
-
status
-
lock_version
-
project_id
-
pipeline_id
-
created_at
...
...
spec/models/ci/stage_spec.rb
View file @
d3814ad6
...
...
@@ -54,7 +54,26 @@ describe Ci::Stage, :models do
end
end
context
'when stage is skipped'
do
it
'updates status to skipped'
do
expect
{
stage
.
update!
}
.
to
change
{
stage
.
reload
.
status
}
.
to
'skipped'
end
end
context
'when stage object is locked'
do
before
do
create
(
:ci_build
,
:failed
,
stage_id:
stage
.
id
)
end
it
'retries a lock to update a stage status'
do
stage
.
lock_version
=
100
stage
.
update!
expect
(
stage
.
reload
).
to
be_failed
end
end
end
end
spec/services/ci/retry_build_service_spec.rb
View file @
d3814ad6
...
...
@@ -22,7 +22,7 @@ describe Ci::RetryBuildService, :services do
%i[type lock_version target_url base_tags
commit_id deployments erased_by_id last_deployment project_id
runner_id tag_taggings taggings tags trigger_request_id
user_id auto_canceled_by_id retried]
.
freeze
user_id auto_canceled_by_id retried
stage_entity
]
.
freeze
shared_examples
'build duplication'
do
let
(
:stage
)
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