diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-21 15:09:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-21 15:09:11 +0000 |
commit | 97a128c1d1bf45bcc00d5fae037f840eff1ae4e0 (patch) | |
tree | bb599771ab8da98296a8fbd4573b9eaf137ea315 /spec/support | |
parent | 7f521d27811b472c43203ed3d1bde4460a617f89 (diff) | |
download | gitlab-ce-97a128c1d1bf45bcc00d5fae037f840eff1ae4e0.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
3 files changed, 12 insertions, 6 deletions
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 |