From 97a128c1d1bf45bcc00d5fae037f840eff1ae4e0 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 21 Mar 2023 15:09:11 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/support/models/ci/partitioning_testing/rspec_hooks.rb | 4 ++++ .../services/issuable_update_service_shared_examples.rb | 10 ++++++---- .../usage_data_counters/issuable_activity_shared_examples.rb | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'spec/support') diff --git a/spec/support/models/ci/partitioning_testing/rspec_hooks.rb b/spec/support/models/ci/partitioning_testing/rspec_hooks.rb index 39b15ba8721..3f0a2bb7f3b 100644 --- a/spec/support/models/ci/partitioning_testing/rspec_hooks.rb +++ b/spec/support/models/ci/partitioning_testing/rspec_hooks.rb @@ -4,6 +4,10 @@ RSpec.configure do |config| config.include Ci::PartitioningTesting::PartitionIdentifiers config.around(:each, :ci_partitionable) do |example| + unless Ci::Build.table_name.to_s.starts_with?('p_') + skip 'Skipping partitioning tests until `ci_builds` is partitioned' + end + Ci::PartitioningTesting::SchemaHelpers.with_routing_tables do example.run end diff --git a/spec/support/services/issuable_update_service_shared_examples.rb b/spec/support/services/issuable_update_service_shared_examples.rb index feea21be428..68202e5fab3 100644 --- a/spec/support/services/issuable_update_service_shared_examples.rb +++ b/spec/support/services/issuable_update_service_shared_examples.rb @@ -23,8 +23,9 @@ RSpec.shared_examples 'issuable update service' do end it 'executes hooks' do - expect(project).to receive(:execute_hooks).with(expected_payload, hook_event) - expect(project).to receive(:execute_integrations).with(expected_payload, hook_event) + hooks_container = described_class < Issues::BaseService ? project.project_namespace : project + expect(hooks_container).to receive(:execute_hooks).with(expected_payload, hook_event) + expect(hooks_container).to receive(:execute_integrations).with(expected_payload, hook_event) described_class.new(**described_class.constructor_container_arg(project), current_user: user, params: { state_event: 'reopen' }).execute(closed_issuable) end @@ -45,8 +46,9 @@ RSpec.shared_examples 'issuable update service' do end it 'executes hooks' do - expect(project).to receive(:execute_hooks).with(expected_payload, hook_event) - expect(project).to receive(:execute_integrations).with(expected_payload, hook_event) + hooks_container = described_class < Issues::BaseService ? project.project_namespace : project + expect(hooks_container).to receive(:execute_hooks).with(expected_payload, hook_event) + expect(hooks_container).to receive(:execute_integrations).with(expected_payload, hook_event) described_class.new(**described_class.constructor_container_arg(project), current_user: user, params: { state_event: 'close' }).execute(open_issuable) end diff --git a/spec/support/shared_examples/lib/gitlab/usage_data_counters/issuable_activity_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/usage_data_counters/issuable_activity_shared_examples.rb index 9873bab1caf..6f7d5784a5c 100644 --- a/spec/support/shared_examples/lib/gitlab/usage_data_counters/issuable_activity_shared_examples.rb +++ b/spec/support/shared_examples/lib/gitlab/usage_data_counters/issuable_activity_shared_examples.rb @@ -37,8 +37,8 @@ RSpec.shared_examples 'daily tracked issuable snowplow and service ping events w .to_h end - let(:track_params) { { project: project } } - let(:event_params) { track_params.merge(label: event_label, property: event_property, namespace: project.namespace, context: [context]) } + let(:track_params) { original_params || { project: project } } + let(:event_params) { { project: project }.merge(label: event_label, property: event_property, namespace: project.namespace, context: [context]) } end end -- cgit v1.2.1