diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-11 15:08:39 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-11 15:08:39 +0000 |
commit | 4564f677f8d71e814e89618e81709c86cf50e3d2 (patch) | |
tree | 9ba8fffbd8b3ec3d40dc12bfc4132d842f789cfc /spec | |
parent | 0b54f87a31c23544ca5917bf772ce9c64a61562c (diff) | |
download | gitlab-ce-4564f677f8d71e814e89618e81709c86cf50e3d2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/invites_spec.rb | 36 | ||||
-rw-r--r-- | spec/frontend/ci/runner/components/runner_bulk_delete_spec.js | 12 | ||||
-rw-r--r-- | spec/lib/gitlab/database/load_balancing/service_discovery_spec.rb | 17 | ||||
-rw-r--r-- | spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb | 18 | ||||
-rw-r--r-- | spec/models/ci/build_spec.rb | 25 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 1 | ||||
-rw-r--r-- | spec/requests/api/environments_spec.rb | 35 | ||||
-rw-r--r-- | spec/requests/api/graphql/ci/ci_cd_setting_spec.rb | 1 | ||||
-rw-r--r-- | spec/requests/api/graphql/mutations/ci/project_ci_cd_settings_update_spec.rb | 15 | ||||
-rw-r--r-- | spec/requests/api/metrics/user_starred_dashboards_spec.rb | 28 | ||||
-rw-r--r-- | spec/requests/api/project_attributes.yml | 1 | ||||
-rw-r--r-- | spec/requests/api/projects_spec.rb | 1 | ||||
-rw-r--r-- | spec/support/helpers/login_helpers.rb | 4 | ||||
-rw-r--r-- | spec/support/rspec_order_todo.yml | 2 | ||||
-rw-r--r-- | spec/workers/pipeline_process_worker_spec.rb | 44 |
15 files changed, 96 insertions, 144 deletions
diff --git a/spec/features/invites_spec.rb b/spec/features/invites_spec.rb index a4cb8a37e93..a3d4b30b59c 100644 --- a/spec/features/invites_spec.rb +++ b/spec/features/invites_spec.rb @@ -28,14 +28,10 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_cate fill_in 'new_user_username', with: new_user.username fill_in 'new_user_email', with: new_user.email fill_in 'new_user_password', with: new_user.password - click_button submit_button_text - end - def fill_in_sign_in_form(user) - fill_in 'user_login', with: user.email - fill_in 'user_password', with: user.password - check 'user_remember_me' - click_button 'Sign in' + wait_for_all_requests + + click_button submit_button_text end def fill_in_welcome_form @@ -73,7 +69,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_cate end end - context 'when invite is sent before account is created - ldap or service sign in for manual acceptance edge case' do + context 'when invite is sent before account is created;ldap or service sign in for manual acceptance edge case' do let(:user) { create(:user, email: 'user@example.com') } context 'when invite clicked and not signed in' do @@ -84,7 +80,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_cate it 'sign in, grants access and redirects to group activity page' do click_link 'Sign in' - fill_in_sign_in_form(user) + gitlab_sign_in(user, remember: true, visit: false) expect(page).to have_current_path(activity_group_path(group), ignore_query: true) end @@ -175,17 +171,19 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_cate fill_in_sign_up_form(new_user) expect(page).to have_current_path(new_user_session_path, ignore_query: true) - expect(page).to have_content('You have signed up successfully. However, we could not sign you in because your account is awaiting approval from your GitLab administrator') + sign_up_message = 'You have signed up successfully. However, we could not sign you in because your account ' \ + 'is awaiting approval from your GitLab administrator.' + expect(page).to have_content(sign_up_message) end end - context 'email confirmation disabled' do + context 'with email confirmation disabled' do before do stub_application_setting_enum('email_confirmation_setting', 'off') end - context 'the user signs up for an account with the invitation email address' do - it 'redirects to the most recent membership activity page with all the projects/groups invitations automatically accepted' do + context 'when the user signs up for an account with the invitation email address' do + it 'redirects to the most recent membership activity page with all invitations automatically accepted' do fill_in_sign_up_form(new_user) fill_in_welcome_form @@ -194,7 +192,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_cate end end - context 'the user sign-up using a different email address' do + context 'when the user sign-up using a different email address' do let(:invite_email) { build_stubbed(:user).email } it 'signs up and redirects to the activity page' do @@ -206,7 +204,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_cate end end - context 'email confirmation enabled' do + context 'with email confirmation enabled' do context 'when user is not valid in sign up form' do let(:new_user) { build_stubbed(:user, password: '11111111') } @@ -232,8 +230,8 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_cate end end - context 'the user signs up for an account with the invitation email address' do - it 'redirects to the most recent membership activity page with all the projects/groups invitations automatically accepted' do + context 'when the user signs up for an account with the invitation email address' do + it 'redirects to the most recent membership activity page with all invitations automatically accepted' do fill_in_sign_up_form(new_user) fill_in_welcome_form @@ -241,7 +239,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_cate end end - context 'the user sign-up using a different email address' do + context 'when the user signs up using a different email address' do let(:invite_email) { build_stubbed(:user).email } context 'when email confirmation is not set to `soft`' do @@ -253,7 +251,7 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures, feature_cate it 'signs up and redirects to the group activity page' do fill_in_sign_up_form(new_user) confirm_email(new_user) - fill_in_sign_in_form(new_user) + gitlab_sign_in(new_user, remember: true, visit: false) fill_in_welcome_form expect(page).to have_current_path(activity_group_path(group), ignore_query: true) diff --git a/spec/frontend/ci/runner/components/runner_bulk_delete_spec.js b/spec/frontend/ci/runner/components/runner_bulk_delete_spec.js index f609c6be41a..7bd4b701002 100644 --- a/spec/frontend/ci/runner/components/runner_bulk_delete_spec.js +++ b/spec/frontend/ci/runner/components/runner_bulk_delete_spec.js @@ -8,6 +8,7 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { s__ } from '~/locale'; import RunnerBulkDelete from '~/ci/runner/components/runner_bulk_delete.vue'; import createMockApollo from 'helpers/mock_apollo_helper'; +import { stubComponent } from 'helpers/stub_component'; import BulkRunnerDeleteMutation from '~/ci/runner/graphql/list/bulk_runner_delete.mutation.graphql'; import { createLocalState } from '~/ci/runner/graphql/list/local_state'; import waitForPromises from 'helpers/wait_for_promises'; @@ -34,7 +35,7 @@ describe('RunnerBulkDelete', () => { const bulkRunnerDeleteHandler = jest.fn(); - const createComponent = () => { + const createComponent = ({ stubs } = {}) => { const { cacheConfig, localMutations } = mockState; const apolloProvider = createMockApollo( [[BulkRunnerDeleteMutation, bulkRunnerDeleteHandler]], @@ -56,6 +57,7 @@ describe('RunnerBulkDelete', () => { stubs: { GlSprintf, GlModal, + ...stubs, }, }); @@ -135,11 +137,15 @@ describe('RunnerBulkDelete', () => { beforeEach(() => { mockCheckedRunnerIds([mockId1, mockId2]); + mockHideModal = jest.fn(); - createComponent(); + createComponent({ + stubs: { + GlModal: stubComponent(GlModal, { methods: { hide: mockHideModal } }), + }, + }); jest.spyOn(mockState.localMutations, 'clearChecked').mockImplementation(() => {}); - mockHideModal = jest.spyOn(findModal().vm, 'hide').mockImplementation(() => {}); }); describe('when deletion is confirmed', () => { diff --git a/spec/lib/gitlab/database/load_balancing/service_discovery_spec.rb b/spec/lib/gitlab/database/load_balancing/service_discovery_spec.rb index bfd9c644ffa..9a559c7ccb4 100644 --- a/spec/lib/gitlab/database/load_balancing/service_discovery_spec.rb +++ b/spec/lib/gitlab/database/load_balancing/service_discovery_spec.rb @@ -90,7 +90,7 @@ RSpec.describe Gitlab::Database::LoadBalancing::ServiceDiscovery, feature_catego end end - context 'with failures' do + context 'with StandardError' do before do allow(Gitlab::ErrorTracking).to receive(:track_exception) allow(service).to receive(:sleep) @@ -142,6 +142,21 @@ RSpec.describe Gitlab::Database::LoadBalancing::ServiceDiscovery, feature_catego service.perform_service_discovery end end + + context 'with Exception' do + it 'logs error and re-raises the exception' do + error = Exception.new('uncaught-test-error') + + expect(service).to receive(:refresh_if_necessary).and_raise(error) + + expect(Gitlab::Database::LoadBalancing::Logger).to receive(:error).with( + event: :service_discovery_unexpected_exception, + message: "Service discovery encountered an uncaught error: uncaught-test-error" + ) + + expect { service.perform_service_discovery }.to raise_error(Exception, error.message) + end + end end describe '#refresh_if_necessary' do diff --git a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb index 8e6aea96c58..a46275d90b6 100644 --- a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb @@ -64,15 +64,6 @@ RSpec.describe Gitlab::SidekiqMiddleware::DuplicateJobs::DuplicateJob, :clean_gi it_behaves_like 'scheduling with deduplication class', 'None' end end - - # This context is to be removed when FF `ci_pipeline_process_worker_dedup_until_executed` is removed - context 'when deduplication strategy is provided in the job options' do - before do - job['deduplicate'] = { 'strategy' => 'until_executed' } - end - - it_behaves_like 'scheduling with deduplication class', 'UntilExecuted' - end end describe '#perform' do @@ -490,15 +481,6 @@ RSpec.describe Gitlab::SidekiqMiddleware::DuplicateJobs::DuplicateJob, :clean_gi expect(duplicate_job.options).to eq(worker_options) end - - # This context is to be removed when FF `ci_pipeline_process_worker_dedup_until_executed` is removed - context 'when deduplication options are provided in the job options' do - it "returns the job's deduplication options" do - job['deduplicate'] = { 'options' => { 'if_deduplicated' => 'reschedule_once', 'ttl' => '60' } } - - expect(duplicate_job.options).to eq({ if_deduplicated: :reschedule_once, ttl: 60 }) - end - end end describe '#idempotent?' do diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 4657a95a7ac..7c32c6d74c8 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -2955,14 +2955,6 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def end end - context 'when the opt_in_jwt project setting is true' do - it 'does not include the JWT variables' do - project.ci_cd_settings.update!(opt_in_jwt: true) - - expect(subject.pluck(:key)).not_to include('CI_JOB_JWT', 'CI_JOB_JWT_V1', 'CI_JOB_JWT_V2') - end - end - describe 'variables ordering' do context 'when variables hierarchy is stubbed' do let(:build_pre_var) { { key: 'build', value: 'value', public: true, masked: false } } @@ -3153,6 +3145,23 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def end end end + + context 'when the build has ID tokens' do + before do + build.update!( + id_tokens: { 'TEST_ID_TOKEN' => { 'aud' => 'https://client.test' } } + ) + end + + it 'includes the tokens and excludes the predefined JWT variables' do + runner_vars = subject.to_runner_variables.pluck(:key) + + expect(runner_vars).to include('TEST_ID_TOKEN') + expect(runner_vars).not_to include('CI_JOB_JWT') + expect(runner_vars).not_to include('CI_JOB_JWT_V1') + expect(runner_vars).not_to include('CI_JOB_JWT_V2') + end + end end context 'when build has user' do diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index b5b7a283e39..855c5f66554 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1095,7 +1095,6 @@ RSpec.describe Project, factory_default: :keep, feature_category: :projects do 'restrict_user_defined_variables' => '', 'runner_token_expiration_interval' => '', 'separated_caches' => 'ci_', - 'opt_in_jwt' => 'ci_', 'allow_fork_pipelines_to_run_in_parent_project' => 'ci_', 'inbound_job_token_scope_enabled' => 'ci_', 'job_token_scope_enabled' => 'ci_outbound_' diff --git a/spec/requests/api/environments_spec.rb b/spec/requests/api/environments_spec.rb index 01fffb9db24..9a435b3bce9 100644 --- a/spec/requests/api/environments_spec.rb +++ b/spec/requests/api/environments_spec.rb @@ -220,14 +220,6 @@ RSpec.describe API::Environments, feature_category: :continuous_delivery do expect(json_response['external_url']).to eq(url) end - it 'returns a 400 if name is changed' do - put api("/projects/#{project.id}/environments/#{environment.id}", user), - params: { name: 'Mepmep' } - - expect(response).to have_gitlab_http_status(:bad_request) - expect(json_response['message']).to eq(described_class::ENVIRONMENT_NAME_UPDATE_ERROR) - end - it 'returns a 200 if tier is changed' do put api("/projects/#{project.id}/environments/#{environment.id}", user), params: { tier: 'production' } @@ -251,33 +243,6 @@ RSpec.describe API::Environments, feature_category: :continuous_delivery do expect(response).to have_gitlab_http_status(:not_found) end - - context 'when disallow_environment_name_update feature flag is disabled' do - before do - stub_feature_flags(disallow_environment_name_update: false) - end - - it 'returns a 200 if name and external_url are changed' do - url = 'https://mepmep.whatever.ninja' - put api("/projects/#{project.id}/environments/#{environment.id}", user), - params: { name: 'Mepmep', external_url: url } - - expect(response).to have_gitlab_http_status(:ok) - expect(response).to match_response_schema('public_api/v4/environment') - expect(json_response['name']).to eq('Mepmep') - expect(json_response['external_url']).to eq(url) - end - - it "won't update the external_url if only the name is passed" do - url = environment.external_url - put api("/projects/#{project.id}/environments/#{environment.id}", user), - params: { name: 'Mepmep' } - - expect(response).to have_gitlab_http_status(:ok) - expect(json_response['name']).to eq('Mepmep') - expect(json_response['external_url']).to eq(url) - end - end end describe 'DELETE /projects/:id/environments/:environment_id' do diff --git a/spec/requests/api/graphql/ci/ci_cd_setting_spec.rb b/spec/requests/api/graphql/ci/ci_cd_setting_spec.rb index 95cabfea2fc..0437a30eccd 100644 --- a/spec/requests/api/graphql/ci/ci_cd_setting_spec.rb +++ b/spec/requests/api/graphql/ci/ci_cd_setting_spec.rb @@ -50,7 +50,6 @@ RSpec.describe 'Getting Ci Cd Setting', feature_category: :continuous_integratio expect(settings_data['jobTokenScopeEnabled']).to eql project.ci_cd_settings.job_token_scope_enabled? expect(settings_data['inboundJobTokenScopeEnabled']).to eql( project.ci_cd_settings.inbound_job_token_scope_enabled?) - expect(settings_data['optInJwt']).to eql project.ci_cd_settings.opt_in_jwt? end end end diff --git a/spec/requests/api/graphql/mutations/ci/project_ci_cd_settings_update_spec.rb b/spec/requests/api/graphql/mutations/ci/project_ci_cd_settings_update_spec.rb index bc979105c27..aa00069b241 100644 --- a/spec/requests/api/graphql/mutations/ci/project_ci_cd_settings_update_spec.rb +++ b/spec/requests/api/graphql/mutations/ci/project_ci_cd_settings_update_spec.rb @@ -22,8 +22,7 @@ RSpec.describe 'ProjectCiCdSettingsUpdate', feature_category: :continuous_integr full_path: project.full_path, keep_latest_artifact: false, job_token_scope_enabled: false, - inbound_job_token_scope_enabled: false, - opt_in_jwt: true + inbound_job_token_scope_enabled: false } end @@ -109,8 +108,7 @@ RSpec.describe 'ProjectCiCdSettingsUpdate', feature_category: :continuous_integr full_path: project.full_path, keep_latest_artifact: false, job_token_scope_enabled: true, - inbound_job_token_scope_enabled: false, - opt_in_jwt: true + inbound_job_token_scope_enabled: false } end @@ -181,15 +179,6 @@ RSpec.describe 'ProjectCiCdSettingsUpdate', feature_category: :continuous_integr end end - it 'updates ci_opt_in_jwt' do - post_graphql_mutation(mutation, current_user: user) - - project.reload - - expect(response).to have_gitlab_http_status(:success) - expect(project.ci_opt_in_jwt).to eq(true) - end - context 'when bad arguments are provided' do let(:variables) { { full_path: '', keep_latest_artifact: false } } diff --git a/spec/requests/api/metrics/user_starred_dashboards_spec.rb b/spec/requests/api/metrics/user_starred_dashboards_spec.rb index 38d3c0be8b2..6fc98de0777 100644 --- a/spec/requests/api/metrics/user_starred_dashboards_spec.rb +++ b/spec/requests/api/metrics/user_starred_dashboards_spec.rb @@ -15,6 +15,10 @@ RSpec.describe API::Metrics::UserStarredDashboards, feature_category: :metrics d } end + before do + stub_feature_flags(remove_monitor_metrics: false) + end + describe 'POST /projects/:id/metrics/user_starred_dashboards' do before do project.add_reporter(user) @@ -84,6 +88,18 @@ RSpec.describe API::Metrics::UserStarredDashboards, feature_category: :metrics d expect(response).to have_gitlab_http_status(:not_found) end end + + context 'when metrics dashboard feature is unavailable' do + before do + stub_feature_flags(remove_monitor_metrics: true) + end + + it 'returns 404 not found' do + post api(url, user), params: params + + expect(response).to have_gitlab_http_status(:not_found) + end + end end describe 'DELETE /projects/:id/metrics/user_starred_dashboards' do @@ -161,5 +177,17 @@ RSpec.describe API::Metrics::UserStarredDashboards, feature_category: :metrics d expect(response).to have_gitlab_http_status(:not_found) end end + + context 'when metrics dashboard feature is unavailable' do + before do + stub_feature_flags(remove_monitor_metrics: true) + end + + it 'returns 404 not found' do + delete api(url, user), params: params + + expect(response).to have_gitlab_http_status(:not_found) + end + end end end diff --git a/spec/requests/api/project_attributes.yml b/spec/requests/api/project_attributes.yml index 91d4dcd2572..e9581265bb0 100644 --- a/spec/requests/api/project_attributes.yml +++ b/spec/requests/api/project_attributes.yml @@ -99,7 +99,6 @@ ci_cd_settings: forward_deployment_enabled: ci_forward_deployment_enabled job_token_scope_enabled: ci_job_token_scope_enabled separated_caches: ci_separated_caches - opt_in_jwt: ci_opt_in_jwt allow_fork_pipelines_to_run_in_parent_project: ci_allow_fork_pipelines_to_run_in_parent_project build_import_state: # import_state diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 725268d9b6a..17a6eec2a8e 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -3049,7 +3049,6 @@ RSpec.describe API::Projects, :aggregate_failures, feature_category: :projects d 'ci_forward_deployment_enabled', 'ci_job_token_scope_enabled', 'ci_separated_caches', - 'ci_opt_in_jwt', 'ci_allow_fork_pipelines_to_run_in_parent_project', 'build_git_strategy', 'keep_latest_artifact', diff --git a/spec/support/helpers/login_helpers.rb b/spec/support/helpers/login_helpers.rb index 6bbee6a7926..67315b9d81e 100644 --- a/spec/support/helpers/login_helpers.rb +++ b/spec/support/helpers/login_helpers.rb @@ -94,8 +94,8 @@ module LoginHelpers # remember - Whether or not to check "Remember me" (default: false) # two_factor_auth - If two-factor authentication is enabled (default: false) # password - password to attempt to login with (default: user.password) - def gitlab_sign_in_with(user, remember: false, two_factor_auth: false, password: nil) - visit new_user_session_path + def gitlab_sign_in_with(user, remember: false, two_factor_auth: false, password: nil, visit: true) + visit new_user_session_path if visit fill_in "user_login", with: user.email fill_in "user_password", with: (password || user.password) diff --git a/spec/support/rspec_order_todo.yml b/spec/support/rspec_order_todo.yml index a451ab27f21..1d6620f0bc8 100644 --- a/spec/support/rspec_order_todo.yml +++ b/spec/support/rspec_order_todo.yml @@ -325,7 +325,6 @@ - './ee/spec/features/groups/wiki/user_views_wiki_empty_spec.rb' - './ee/spec/features/ide/user_opens_ide_spec.rb' - './ee/spec/features/integrations/jira/jira_issues_list_spec.rb' -- './ee/spec/features/invites_spec.rb' - './ee/spec/features/issues/blocking_issues_spec.rb' - './ee/spec/features/issues/epic_in_issue_sidebar_spec.rb' - './ee/spec/features/issues/filtered_search/filter_issues_by_iteration_spec.rb' @@ -3748,7 +3747,6 @@ - './spec/features/ide/static_object_external_storage_csp_spec.rb' - './spec/features/ide/user_opens_merge_request_spec.rb' - './spec/features/import/manifest_import_spec.rb' -- './spec/features/invites_spec.rb' - './spec/features/issuables/issuable_list_spec.rb' - './spec/features/issuables/markdown_references/internal_references_spec.rb' - './spec/features/issuables/markdown_references/jira_spec.rb' diff --git a/spec/workers/pipeline_process_worker_spec.rb b/spec/workers/pipeline_process_worker_spec.rb index 1c76cdca347..6ee91b4579d 100644 --- a/spec/workers/pipeline_process_worker_spec.rb +++ b/spec/workers/pipeline_process_worker_spec.rb @@ -5,46 +5,12 @@ require 'spec_helper' RSpec.describe PipelineProcessWorker, feature_category: :continuous_integration do let_it_be(:pipeline) { create(:ci_pipeline) } - # The two examples below are to be added when FF `ci_pipeline_process_worker_dedup_until_executed` is removed - # it 'has the `until_executed` deduplicate strategy' do - # expect(described_class.get_deduplicate_strategy).to eq(:until_executed) - # end - - # it 'has the option to reschedule once if deduplicated and a TTL of 1 minute' do - # expect(described_class.get_deduplication_options).to include({ if_deduplicated: :reschedule_once, ttl: 1.minute }) - # end - - # This context is to be removed when FF `ci_pipeline_process_worker_dedup_until_executed` is removed - describe '#perform_async', :sidekiq_inline do - around do |example| - Sidekiq::Testing.fake! { example.run } - end - - let_it_be(:project) { create(:project, :repository) } - let_it_be(:pipeline) { create(:ci_empty_pipeline, project: project) } - - subject { described_class.perform_async(pipeline.id) } - - it 'sets the deduplication settings in the job options' do - subject - - job = described_class.jobs.last - expect(job['deduplicate']).to eq({ 'strategy' => 'until_executed', - 'options' => { 'if_deduplicated' => 'reschedule_once', 'ttl' => '60' } }) - end - - context 'when FF `ci_pipeline_process_worker_dedup_until_executed` is disabled' do - before do - stub_feature_flags(ci_pipeline_process_worker_dedup_until_executed: false) - end - - it 'does not set the deduplication settings in the job options' do - subject + it 'has the `until_executed` deduplicate strategy' do + expect(described_class.get_deduplicate_strategy).to eq(:until_executed) + end - job = described_class.jobs.last - expect(job['deduplicate']).to be_nil - end - end + it 'has the option to reschedule once if deduplicated and a TTL of 1 minute' do + expect(described_class.get_deduplication_options).to include({ if_deduplicated: :reschedule_once, ttl: 1.minute }) end include_examples 'an idempotent worker' do |