diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/migrations/20210818185845_backfill_projects_with_coverage_spec.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/migrations/20210818185845_backfill_projects_with_coverage_spec.rb')
-rw-r--r-- | spec/migrations/20210818185845_backfill_projects_with_coverage_spec.rb | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/spec/migrations/20210818185845_backfill_projects_with_coverage_spec.rb b/spec/migrations/20210818185845_backfill_projects_with_coverage_spec.rb deleted file mode 100644 index 13a6aa5413e..00000000000 --- a/spec/migrations/20210818185845_backfill_projects_with_coverage_spec.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe BackfillProjectsWithCoverage, :suppress_gitlab_schemas_validate_connection do - let(:projects) { table(:projects) } - let(:ci_pipelines) { table(:ci_pipelines) } - let(:ci_daily_build_group_report_results) { table(:ci_daily_build_group_report_results) } - let(:group) { table(:namespaces).create!(name: 'user', path: 'user') } - let(:project_1) { projects.create!(namespace_id: group.id) } - let(:project_2) { projects.create!(namespace_id: group.id) } - let(:pipeline_1) { ci_pipelines.create!(project_id: project_1.id) } - let(:pipeline_2) { ci_pipelines.create!(project_id: project_2.id) } - let(:pipeline_3) { ci_pipelines.create!(project_id: project_2.id) } - - describe '#up' do - before do - stub_const("#{described_class}::BATCH_SIZE", 2) - stub_const("#{described_class}::SUB_BATCH_SIZE", 1) - - ci_daily_build_group_report_results.create!( - id: 1, - project_id: project_1.id, - date: 3.days.ago, - last_pipeline_id: pipeline_1.id, - ref_path: 'main', - group_name: 'rspec', - data: { coverage: 95.0 }, - default_branch: true, - group_id: group.id - ) - - ci_daily_build_group_report_results.create!( - id: 2, - project_id: project_2.id, - date: 2.days.ago, - last_pipeline_id: pipeline_2.id, - ref_path: 'main', - group_name: 'rspec', - data: { coverage: 95.0 }, - default_branch: true, - group_id: group.id - ) - - ci_daily_build_group_report_results.create!( - id: 3, - project_id: project_2.id, - date: 1.day.ago, - last_pipeline_id: pipeline_3.id, - ref_path: 'test_branch', - group_name: 'rspec', - data: { coverage: 95.0 }, - default_branch: false, - group_id: group.id - ) - end - - it 'schedules BackfillProjectsWithCoverage background jobs', :aggregate_failures do - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(2.minutes, 1, 2, 1) - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(4.minutes, 3, 3, 1) - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - end - end - end - end -end |