summaryrefslogtreecommitdiff
path: root/lib/tasks/contracts
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-20 14:22:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-20 14:22:11 +0000
commit0c872e02b2c822e3397515ec324051ff540f0cd5 (patch)
treece2fb6ce7030e4dad0f4118d21ab6453e5938cdd /lib/tasks/contracts
parentf7e05a6853b12f02911494c4b3fe53d9540d74fc (diff)
downloadgitlab-ce-0c872e02b2c822e3397515ec324051ff540f0cd5.tar.gz
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'lib/tasks/contracts')
-rw-r--r--lib/tasks/contracts/merge_requests.rake26
-rw-r--r--lib/tasks/contracts/pipeline_schedules.rake9
-rw-r--r--lib/tasks/contracts/pipelines.rake31
3 files changed, 40 insertions, 26 deletions
diff --git a/lib/tasks/contracts/merge_requests.rake b/lib/tasks/contracts/merge_requests.rake
index 2ee7ec07a96..61823f0cf1a 100644
--- a/lib/tasks/contracts/merge_requests.rake
+++ b/lib/tasks/contracts/merge_requests.rake
@@ -4,29 +4,35 @@ return if Rails.env.production?
require 'pact/tasks/verification_task'
-contracts = File.expand_path('../../../spec/contracts/contracts/project/merge_request', __dir__)
provider = File.expand_path('../../../spec/contracts/provider', __dir__)
namespace :contracts do
+ require_relative "../../../spec/contracts/provider/helpers/contract_source_helper"
+
namespace :merge_requests do
- Pact::VerificationTask.new(:diffs_batch) do |pact|
+ Pact::VerificationTask.new(:get_diffs_batch) do |pact|
+ pact_helper_location = "pact_helpers/project/merge_requests/show/get_diffs_batch_helper.rb"
+
pact.uri(
- "#{contracts}/show/mergerequest#show-merge_request_diffs_batch_endpoint.json",
- pact_helper: "#{provider}/pact_helpers/project/merge_request/show/diffs_batch_helper.rb"
+ Provider::ContractSourceHelper.contract_location(:rake, pact_helper_location),
+ pact_helper: "#{provider}/#{pact_helper_location}"
)
end
- Pact::VerificationTask.new(:diffs_metadata) do |pact|
+ Pact::VerificationTask.new(:get_diffs_metadata) do |pact|
+ pact_helper_location = "pact_helpers/project/merge_requests/show/get_diffs_metadata_helper.rb"
pact.uri(
- "#{contracts}/show/mergerequest#show-merge_request_diffs_metadata_endpoint.json",
- pact_helper: "#{provider}/pact_helpers/project/merge_request/show/diffs_metadata_helper.rb"
+ Provider::ContractSourceHelper.contract_location(:rake, pact_helper_location),
+ pact_helper: "#{provider}/#{pact_helper_location}"
)
end
- Pact::VerificationTask.new(:discussions) do |pact|
+ Pact::VerificationTask.new(:get_discussions) do |pact|
+ pact_helper_location = "pact_helpers/project/merge_requests/show/get_discussions_helper.rb"
+
pact.uri(
- "#{contracts}/show/mergerequest#show-merge_request_discussions_endpoint.json",
- pact_helper: "#{provider}/pact_helpers/project/merge_request/show/discussions_helper.rb"
+ Provider::ContractSourceHelper.contract_location(:rake, pact_helper_location),
+ pact_helper: "#{provider}/#{pact_helper_location}"
)
end
diff --git a/lib/tasks/contracts/pipeline_schedules.rake b/lib/tasks/contracts/pipeline_schedules.rake
index 75080d41ebe..b4c87d2e3c9 100644
--- a/lib/tasks/contracts/pipeline_schedules.rake
+++ b/lib/tasks/contracts/pipeline_schedules.rake
@@ -4,15 +4,18 @@ return if Rails.env.production?
require 'pact/tasks/verification_task'
-contracts = File.expand_path('../../../spec/contracts/contracts/project/pipeline_schedule', __dir__)
provider = File.expand_path('../../../spec/contracts/provider', __dir__)
namespace :contracts do
+ require_relative "../../../spec/contracts/provider/helpers/contract_source_helper"
+
namespace :pipeline_schedules do
Pact::VerificationTask.new(:update_pipeline_schedule) do |pact|
+ pact_helper_location = "pact_helpers/project/pipeline_schedules/edit/put_edit_a_pipeline_schedule_helper.rb"
+
pact.uri(
- "#{contracts}/edit/pipelineschedules#edit-put_edit_a_pipeline_schedule.json",
- pact_helper: "#{provider}/pact_helpers/project/pipeline_schedule/update_pipeline_schedule_helper.rb"
+ Provider::ContractSourceHelper.contract_location(:rake, pact_helper_location),
+ pact_helper: "#{provider}/#{pact_helper_location}"
)
end
diff --git a/lib/tasks/contracts/pipelines.rake b/lib/tasks/contracts/pipelines.rake
index 5a8d7791233..55a7baa4539 100644
--- a/lib/tasks/contracts/pipelines.rake
+++ b/lib/tasks/contracts/pipelines.rake
@@ -4,40 +4,45 @@ return if Rails.env.production?
require 'pact/tasks/verification_task'
-contracts = File.expand_path('../../../spec/contracts/contracts/project/pipeline', __dir__)
provider = File.expand_path('../../../spec/contracts/provider', __dir__)
namespace :contracts do
+ require_relative "../../../spec/contracts/provider/helpers/contract_source_helper"
+
namespace :pipelines do
Pact::VerificationTask.new(:create_a_new_pipeline) do |pact|
+ pact_helper_location = "pact_helpers/project/pipelines/new/post_create_a_new_pipeline_helper.rb"
+
pact.uri(
- "#{contracts}/new/pipelines#new-post_create_a_new_pipeline.json",
- pact_helper: "#{provider}/pact_helpers/project/pipeline/index/create_a_new_pipeline_helper.rb"
+ Provider::ContractSourceHelper.contract_location(:rake, pact_helper_location),
+ pact_helper: "#{provider}/#{pact_helper_location}"
)
end
Pact::VerificationTask.new(:get_list_project_pipelines) do |pact|
+ pact_helper_location = "pact_helpers/project/pipelines/index/get_list_project_pipelines_helper.rb"
+
pact.uri(
- "#{contracts}/index/pipelines#index-get_list_project_pipelines.json",
- pact_helper: "#{provider}/pact_helpers/project/pipeline/index/get_list_project_pipelines_helper.rb"
+ Provider::ContractSourceHelper.contract_location(:rake, pact_helper_location),
+ pact_helper: "#{provider}/#{pact_helper_location}"
)
end
Pact::VerificationTask.new(:get_pipeline_header_data) do |pact|
- # pact.uri(
- # "http://localhost:9292/pacts/provider/GET%20pipeline%20header%20data/consumer/Pipelines%23show/latest",
- # pact_helper: "#{provider}/pact_helpers/project/pipeline/show/get_pipeline_header_data_helper.rb"
- # )
+ pact_helper_location = "pact_helpers/project/pipelines/show/get_pipeline_header_data_helper.rb"
+
pact.uri(
- "#{contracts}/show/pipelines#show-get_pipeline_header_data.json",
- pact_helper: "#{provider}/pact_helpers/project/pipeline/show/get_pipeline_header_data_helper.rb"
+ Provider::ContractSourceHelper.contract_location(:rake, pact_helper_location),
+ pact_helper: "#{provider}/#{pact_helper_location}"
)
end
Pact::VerificationTask.new(:delete_pipeline) do |pact|
+ pact_helper_location = "pact_helpers/project/pipelines/show/delete_pipeline_helper.rb"
+
pact.uri(
- "#{contracts}/show/pipelines#show-delete_pipeline.json",
- pact_helper: "#{provider}/pact_helpers/project/pipeline/show/delete_pipeline_helper.rb"
+ Provider::ContractSourceHelper.contract_location(:rake, pact_helper_location),
+ pact_helper: "#{provider}/#{pact_helper_location}"
)
end