summaryrefslogtreecommitdiff
path: root/db/fixtures/development
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2019-07-17 17:17:02 -0500
committerRobert Speicher <rspeicher@gmail.com>2019-07-22 11:45:05 -0500
commit3c6fee700d52db4da1b3662caf6e1dfe76f56977 (patch)
treec877e952ea446a470f0437ab036247da302535dd /db/fixtures/development
parent8073b0554fc8f7dddc250025aaf5cedd09f423cb (diff)
downloadgitlab-ce-3c6fee700d52db4da1b3662caf6e1dfe76f56977.tar.gz
CE-EE parity for pipelines development fixture
Diffstat (limited to 'db/fixtures/development')
-rw-r--r--db/fixtures/development/14_pipelines.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/db/fixtures/development/14_pipelines.rb b/db/fixtures/development/14_pipelines.rb
index db043e39d2c..ffba934021e 100644
--- a/db/fixtures/development/14_pipelines.rb
+++ b/db/fixtures/development/14_pipelines.rb
@@ -79,7 +79,15 @@ class Gitlab::Seeder::Pipelines
def create_master_pipelines
@project.repository.commits('master', limit: 4).map do |commit|
- create_pipeline!(@project, 'master', commit)
+ create_pipeline!(@project, 'master', commit).tap do |pipeline|
+ random_pipeline.tap do |triggered_by_pipeline|
+ triggered_by_pipeline.sourced_pipelines.create(
+ source_job: triggered_by_pipeline.builds.all.sample,
+ source_project: triggered_by_pipeline.project,
+ project: pipeline.project,
+ pipeline: pipeline)
+ end
+ end
end
rescue
[]
@@ -231,6 +239,10 @@ class Gitlab::Seeder::Pipelines
@project.team.users.sample
end
+ def random_pipeline
+ Ci::Pipeline.limit(4).all.sample
+ end
+
def build_status
Ci::Build::AVAILABLE_STATUSES.sample
end