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.rake37
1 files changed, 27 insertions, 10 deletions
diff --git a/lib/tasks/contracts/pipelines.rake b/lib/tasks/contracts/pipelines.rake
index c018645722e..3163791460f 100644
--- a/lib/tasks/contracts/pipelines.rake
+++ b/lib/tasks/contracts/pipelines.rake
@@ -4,29 +4,47 @@ return if Rails.env.production?
require 'pact/tasks/verification_task'
-contracts = File.expand_path('../../../spec/contracts', __dir__)
-provider = File.expand_path('provider', contracts)
+contracts = File.expand_path('../../../spec/contracts/contracts/project/pipeline', __dir__)
+provider = File.expand_path('../../../spec/contracts/provider', __dir__)
-# rubocop:disable Rails/RakeEnvironment
namespace :contracts do
namespace :pipelines do
+ Pact::VerificationTask.new(:create_a_new_pipeline) do |pact|
+ 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"
+ )
+ end
+
Pact::VerificationTask.new(:get_list_project_pipelines) do |pact|
pact.uri(
- "#{contracts}/contracts/project/pipeline/index/pipelines#index-get_list_project_pipelines.json",
- pact_helper: "#{provider}/pact_helpers/project/pipeline/get_list_project_pipelines_helper.rb"
+ "#{contracts}/index/pipelines#index-get_list_project_pipelines.json",
+ pact_helper: "#{provider}/pact_helpers/project/pipeline/index/get_list_project_pipelines_helper.rb"
)
end
Pact::VerificationTask.new(:get_pipeline_header_data) do |pact|
pact.uri(
- "#{contracts}/contracts/project/pipeline/show/pipelines#show-get_pipeline_header_data.json",
- pact_helper: "#{provider}/pact_helpers/project/pipeline/get_pipeline_header_data_helper.rb"
+ "#{contracts}/show/pipelines#show-get_pipeline_header_data.json",
+ pact_helper: "#{provider}/pact_helpers/project/pipeline/show/get_pipeline_header_data_helper.rb"
+ )
+ end
+
+ Pact::VerificationTask.new(:delete_pipeline) do |pact|
+ pact.uri(
+ "#{contracts}/show/pipelines#show-delete_pipeline.json",
+ pact_helper: "#{provider}/pact_helpers/project/pipeline/show/delete_pipeline_helper.rb"
)
end
desc 'Run all pipeline contract tests'
- task 'test:pipelines', :contract_mr do |_t, arg|
- errors = %w[get_list_project_pipelines get_pipeline_header_data].each_with_object([]) do |task, err|
+ task 'test:pipelines', :contract_pipelines do |_t, arg|
+ errors = %w[
+ create_a_new_pipeline
+ get_list_project_pipelines
+ get_pipeline_header_data
+ delete_pipeline
+ ].each_with_object([]) do |task, err|
Rake::Task["contracts:pipelines:pact:verify:#{task}"].execute
rescue StandardError, SystemExit
err << "contracts:pipelines:pact:verify:#{task}"
@@ -36,4 +54,3 @@ namespace :contracts do
end
end
end
-# rubocop:enable Rails/RakeEnvironment