From 6c9db7d110fec154dda991e3c323027404fbc940 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 1 Sep 2022 06:11:45 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- ...3_fix_incorrect_job_artifacts_expire_at_spec.rb | 42 ---------------------- ...9_fix_incorrect_job_artifacts_expire_at_spec.rb | 42 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 42 deletions(-) delete mode 100644 spec/migrations/20220606054503_fix_incorrect_job_artifacts_expire_at_spec.rb create mode 100644 spec/migrations/20220606080509_fix_incorrect_job_artifacts_expire_at_spec.rb (limited to 'spec/migrations') diff --git a/spec/migrations/20220606054503_fix_incorrect_job_artifacts_expire_at_spec.rb b/spec/migrations/20220606054503_fix_incorrect_job_artifacts_expire_at_spec.rb deleted file mode 100644 index 5921dd64c0e..00000000000 --- a/spec/migrations/20220606054503_fix_incorrect_job_artifacts_expire_at_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe FixIncorrectJobArtifactsExpireAt, migration: :gitlab_ci do - let_it_be(:batched_migration) { described_class::MIGRATION } - - it 'does not schedule background jobs when Gitlab.com is true' do - allow(Gitlab).to receive(:com?).and_return(true) - - reversible_migration do |migration| - migration.before -> { - expect(batched_migration).not_to have_scheduled_batched_migration - } - - migration.after -> { - expect(batched_migration).not_to have_scheduled_batched_migration - } - end - end - - it 'schedules background job on non Gitlab.com' do - allow(Gitlab).to receive(:com?).and_return(false) - - reversible_migration do |migration| - migration.before -> { - expect(batched_migration).not_to have_scheduled_batched_migration - } - - migration.after -> { - expect(batched_migration).to have_scheduled_batched_migration( - gitlab_schema: :gitlab_ci, - table_name: :ci_job_artifacts, - column_name: :id, - interval: described_class::INTERVAL, - batch_size: described_class::BATCH_SIZE - ) - } - end - end -end diff --git a/spec/migrations/20220606080509_fix_incorrect_job_artifacts_expire_at_spec.rb b/spec/migrations/20220606080509_fix_incorrect_job_artifacts_expire_at_spec.rb new file mode 100644 index 00000000000..5921dd64c0e --- /dev/null +++ b/spec/migrations/20220606080509_fix_incorrect_job_artifacts_expire_at_spec.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration! + +RSpec.describe FixIncorrectJobArtifactsExpireAt, migration: :gitlab_ci do + let_it_be(:batched_migration) { described_class::MIGRATION } + + it 'does not schedule background jobs when Gitlab.com is true' do + allow(Gitlab).to receive(:com?).and_return(true) + + reversible_migration do |migration| + migration.before -> { + expect(batched_migration).not_to have_scheduled_batched_migration + } + + migration.after -> { + expect(batched_migration).not_to have_scheduled_batched_migration + } + end + end + + it 'schedules background job on non Gitlab.com' do + allow(Gitlab).to receive(:com?).and_return(false) + + reversible_migration do |migration| + migration.before -> { + expect(batched_migration).not_to have_scheduled_batched_migration + } + + migration.after -> { + expect(batched_migration).to have_scheduled_batched_migration( + gitlab_schema: :gitlab_ci, + table_name: :ci_job_artifacts, + column_name: :id, + interval: described_class::INTERVAL, + batch_size: described_class::BATCH_SIZE + ) + } + end + end +end -- cgit v1.2.3