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
f9228f6b
Commit
f9228f6b
authored
Jul 04, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for stage status migration with retried jobs
parent
d60ce6e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
spec/migrations/migrate_stages_statuses_spec.rb
spec/migrations/migrate_stages_statuses_spec.rb
+4
-4
No files found.
spec/migrations/migrate_stages_statuses_spec.rb
View file @
f9228f6b
...
@@ -24,6 +24,7 @@ describe MigrateStagesStatuses, :migration do
...
@@ -24,6 +24,7 @@ describe MigrateStagesStatuses, :migration do
create_job
(
project:
1
,
pipeline:
1
,
stage:
'build'
,
status:
'failed'
)
create_job
(
project:
1
,
pipeline:
1
,
stage:
'build'
,
status:
'failed'
)
create_job
(
project:
2
,
pipeline:
2
,
stage:
'test'
,
status:
'success'
)
create_job
(
project:
2
,
pipeline:
2
,
stage:
'test'
,
status:
'success'
)
create_job
(
project:
2
,
pipeline:
2
,
stage:
'test'
,
status:
'success'
)
create_job
(
project:
2
,
pipeline:
2
,
stage:
'test'
,
status:
'success'
)
create_job
(
project:
2
,
pipeline:
2
,
stage:
'test'
,
status:
'failed'
,
retried:
true
)
stages
.
create!
(
id:
1
,
pipeline_id:
1
,
project_id:
1
,
name:
'test'
,
status:
nil
)
stages
.
create!
(
id:
1
,
pipeline_id:
1
,
project_id:
1
,
name:
'test'
,
status:
nil
)
stages
.
create!
(
id:
2
,
pipeline_id:
1
,
project_id:
1
,
name:
'build'
,
status:
nil
)
stages
.
create!
(
id:
2
,
pipeline_id:
1
,
project_id:
1
,
name:
'build'
,
status:
nil
)
...
@@ -40,10 +41,9 @@ describe MigrateStagesStatuses, :migration do
...
@@ -40,10 +41,9 @@ describe MigrateStagesStatuses, :migration do
.
to
eq
[
STATUSES
[
:running
],
STATUSES
[
:failed
],
STATUSES
[
:success
]]
.
to
eq
[
STATUSES
[
:running
],
STATUSES
[
:failed
],
STATUSES
[
:success
]]
end
end
def
create_job
(
project
:,
pipeline
:,
stage
:,
status
:)
def
create_job
(
project
:,
pipeline
:,
stage
:,
status
:,
**
opts
)
stage_idx
=
STAGES
[
stage
.
to_sym
]
jobs
.
create!
(
project_id:
project
,
commit_id:
pipeline
,
jobs
.
create!
(
project_id:
project
,
commit_id:
pipeline
,
stage_idx:
stage_idx
,
stage:
stage
,
status:
status
)
stage_idx:
STAGES
[
stage
.
to_sym
],
stage:
stage
,
status:
status
,
**
opts
)
end
end
end
end
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