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
1e62a139
Commit
1e62a139
authored
Nov 28, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve pipeline fixtures
parent
02c6cbf5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
19 deletions
+44
-19
db/fixtures/development/14_pipelines.rb
db/fixtures/development/14_pipelines.rb
+44
-19
No files found.
db/fixtures/development/14_pipelines.rb
View file @
1e62a139
class
Gitlab::Seeder::Pipelines
class
Gitlab::Seeder::Pipelines
STAGES
=
%w[build test deploy notify]
STAGES
=
%w[build test deploy notify]
BUILDS
=
[
BUILDS
=
[
{
name:
'build:linux'
,
stage:
'build'
,
status: :success
},
# build stage
{
name:
'build:osx'
,
stage:
'build'
,
status: :success
},
{
name:
'build:linux'
,
stage:
'build'
,
status: :success
,
{
name:
'rspec:linux 0 3'
,
stage:
'test'
,
status: :success
},
queued_at:
10
.
hour
.
ago
,
started_at:
9
.
hour
.
ago
,
finished_at:
8
.
hour
.
ago
},
{
name:
'rspec:linux 1 3'
,
stage:
'test'
,
status: :success
},
{
name:
'build:osx'
,
stage:
'build'
,
status: :success
,
{
name:
'rspec:linux 2 3'
,
stage:
'test'
,
status: :success
},
queued_at:
10
.
hour
.
ago
,
started_at:
10
.
hour
.
ago
,
finished_at:
9
.
hour
.
ago
},
{
name:
'rspec:windows 0 3'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:windows 1 3'
,
stage:
'test'
,
status: :success
},
# test stage
{
name:
'rspec:windows 2 3'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:linux 0 3'
,
stage:
'test'
,
status: :success
,
{
name:
'rspec:windows 2 3'
,
stage:
'test'
,
status: :success
},
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'rspec:osx'
,
stage:
'test'
,
status_event: :success
},
{
name:
'rspec:linux 1 3'
,
stage:
'test'
,
status: :success
,
{
name:
'spinach:linux'
,
stage:
'test'
,
status: :success
},
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'spinach:osx'
,
stage:
'test'
,
status: :failed
,
allow_failure:
true
},
{
name:
'rspec:linux 2 3'
,
stage:
'test'
,
status: :success
,
{
name:
'env:alpha'
,
stage:
'deploy'
,
environment:
'alpha'
,
status: :pending
},
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'env:beta'
,
stage:
'deploy'
,
environment:
'beta'
,
status: :running
},
{
name:
'rspec:windows 0 3'
,
stage:
'test'
,
status: :success
,
{
name:
'env:gamma'
,
stage:
'deploy'
,
environment:
'gamma'
,
status: :canceled
},
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'staging'
,
stage:
'deploy'
,
environment:
'staging'
,
status_event: :success
,
options:
{
environment:
{
on_stop:
'stop staging'
}
}
},
{
name:
'rspec:windows 1 3'
,
stage:
'test'
,
status: :success
,
{
name:
'stop staging'
,
stage:
'deploy'
,
environment:
'staging'
,
when:
'manual'
,
status: :skipped
},
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'production'
,
stage:
'deploy'
,
environment:
'production'
,
when:
'manual'
,
status: :skipped
},
{
name:
'rspec:windows 2 3'
,
stage:
'test'
,
status: :success
,
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'rspec:windows 2 3'
,
stage:
'test'
,
status: :success
,
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'rspec:osx'
,
stage:
'test'
,
status_event: :success
,
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'spinach:linux'
,
stage:
'test'
,
status: :success
,
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'spinach:osx'
,
stage:
'test'
,
status: :failed
,
allow_failure:
true
,
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
# deploy stage
{
name:
'staging'
,
stage:
'deploy'
,
environment:
'staging'
,
status_event: :success
,
options:
{
environment:
{
action:
'start'
,
on_stop:
'stop staging'
}
},
queued_at:
7
.
hour
.
ago
,
started_at:
6
.
hour
.
ago
,
finished_at:
4
.
hour
.
ago
},
{
name:
'stop staging'
,
stage:
'deploy'
,
environment:
'staging'
,
when:
'manual'
,
status: :skipped
},
{
name:
'production'
,
stage:
'deploy'
,
environment:
'production'
,
when:
'manual'
,
status: :skipped
},
# notify stage
{
name:
'slack'
,
stage:
'notify'
,
when:
'manual'
,
status: :created
},
{
name:
'slack'
,
stage:
'notify'
,
when:
'manual'
,
status: :created
},
]
]
EXTERNAL_JOBS
=
[
{
name:
'jenkins'
,
stage:
'test'
,
status: :success
,
queued_at:
7
.
hour
.
ago
,
started_at:
6
.
hour
.
ago
,
finished_at:
4
.
hour
.
ago
},
]
def
initialize
(
project
)
def
initialize
(
project
)
@project
=
project
@project
=
project
...
@@ -30,11 +54,12 @@ class Gitlab::Seeder::Pipelines
...
@@ -30,11 +54,12 @@ class Gitlab::Seeder::Pipelines
pipelines
.
each
do
|
pipeline
|
pipelines
.
each
do
|
pipeline
|
begin
begin
BUILDS
.
each
{
|
opts
|
build_create!
(
pipeline
,
opts
)
}
BUILDS
.
each
{
|
opts
|
build_create!
(
pipeline
,
opts
)
}
commit_status_create!
(
pipeline
,
name:
'jenkins'
,
stage:
'test'
,
status: :success
)
EXTERNAL_JOBS
.
each
{
|
opts
|
commit_status_create!
(
pipeline
,
opts
)
}
print
'.'
print
'.'
rescue
ActiveRecord
::
RecordInvalid
rescue
ActiveRecord
::
RecordInvalid
print
'F'
print
'F'
ensure
ensure
pipeline
.
update_duration
pipeline
.
update_status
pipeline
.
update_status
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