diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-06-18 22:00:14 +0300 |
---|---|---|
committer | 🤖 GitLab Bot 🤖 <gitlab-bot@gitlab.com> | 2019-06-18 22:20:53 +0300 |
commit | 499bcda0f42a2560c32ff54dce940137a49162fe (patch) | |
tree | b0ae04bcdf2585eeab659c1b42fa660b50ef2fe9 /spec | |
parent | 34e946372896c0f129eefd8577d10e400a4362d6 (diff) |
Merge branch 'revert-concurrent-pipeline-schedule-creation' into 'master'
Revert concurrent pipeline creation for pipeline schedules
See merge request gitlab-org/gitlab-ce!29794
(cherry picked from commit ba952d53c5782e49b59ba3e5dd89c2c1eca02c80)
36b30cf1 Revert concurrent pipeline schedule creation
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/ci/pipeline_schedule_service_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/services/ci/pipeline_schedule_service_spec.rb b/spec/services/ci/pipeline_schedule_service_spec.rb index 867ed0acc0d..f7590720f66 100644 --- a/spec/services/ci/pipeline_schedule_service_spec.rb +++ b/spec/services/ci/pipeline_schedule_service_spec.rb @@ -25,6 +25,38 @@ describe Ci::PipelineScheduleService do subject end + context 'when ci_pipeline_schedule_async feature flag is disabled' do + before do + stub_feature_flags(ci_pipeline_schedule_async: false) + end + + it 'runs RunPipelineScheduleWorker synchronously' do + expect_next_instance_of(RunPipelineScheduleWorker) do |worker| + expect(worker).to receive(:perform).with(schedule.id, schedule.owner.id) + end + + subject + end + + it 'calls Garbage Collection manually' do + expect(GC).to receive(:start) + + subject + end + + context 'when ci_pipeline_schedule_force_gc feature flag is disabled' do + before do + stub_feature_flags(ci_pipeline_schedule_force_gc: false) + end + + it 'does not call Garbage Collection manually' do + expect(GC).not_to receive(:start) + + subject + end + end + end + context 'when owner is nil' do let(:schedule) { create(:ci_pipeline_schedule, project: project, owner: nil) } |