diff options
Diffstat (limited to 'db/fixtures/development')
-rw-r--r-- | db/fixtures/development/10_merge_requests.rb | 2 | ||||
-rw-r--r-- | db/fixtures/development/17_cycle_analytics.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/db/fixtures/development/10_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb index 9157045a7fd..8cda3eb51be 100644 --- a/db/fixtures/development/10_merge_requests.rb +++ b/db/fixtures/development/10_merge_requests.rb @@ -19,7 +19,7 @@ Gitlab::Seeder.quiet do target_branch = branches.pop label_ids = project.labels.pluck(:id).sample(3) - label_ids += project.group.labels.sample(3) if project.group + label_ids += project.group.labels.sample(3).pluck(:id) if project.group params = { source_branch: source_branch, diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb index f5dc2b558d4..57993061c58 100644 --- a/db/fixtures/development/17_cycle_analytics.rb +++ b/db/fixtures/development/17_cycle_analytics.rb @@ -107,6 +107,10 @@ class Gitlab::Seeder::CycleAnalytics pipeline = FactoryBot.create(:ci_pipeline, :success, project: project) build = FactoryBot.create(:ci_build, pipeline: pipeline, project: project, user: developers.sample) + # Required because seeds run in a transaction and these are now + # created in an `after_commit` hook. + merge_request.ensure_metrics + merge_request.metrics.update!( latest_build_started_at: merge_request.created_at, latest_build_finished_at: within_end_time(merge_request.created_at + TEST_STAGE_MAX_DURATION_IN_HOURS.hours), |