Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/contracts/pipelines.rake')
-rw-r--r--lib/tasks/contracts/pipelines.rake31
1 files changed, 18 insertions, 13 deletions
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