diff options
Diffstat (limited to 'qa/contracts/provider')
-rw-r--r-- | qa/contracts/provider/environments/base.rb | 24 | ||||
-rw-r--r-- | qa/contracts/provider/environments/local.rb | 12 | ||||
-rw-r--r-- | qa/contracts/provider/spec/diffs_helper.rb | 17 | ||||
-rw-r--r-- | qa/contracts/provider/spec/discussions_helper.rb | 17 | ||||
-rw-r--r-- | qa/contracts/provider/spec/metadata_helper.rb | 17 | ||||
-rw-r--r-- | qa/contracts/provider/spec_helper.rb | 22 |
6 files changed, 0 insertions, 109 deletions
diff --git a/qa/contracts/provider/environments/base.rb b/qa/contracts/provider/environments/base.rb deleted file mode 100644 index 695ee6b867d..00000000000 --- a/qa/contracts/provider/environments/base.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -module Provider - module Environments - class Base - attr_writer :base_url, :merge_request - - def call(env) - @payload - end - - def http(endpoint) - Faraday.default_adapter = :net_http - response = Faraday.get(@base_url + endpoint) - @payload = [response.status, response.headers, [response.body]] - self - end - - def merge_request(endpoint) - http(@merge_request + endpoint) if endpoint.include? '.json' - end - end - end -end diff --git a/qa/contracts/provider/environments/local.rb b/qa/contracts/provider/environments/local.rb deleted file mode 100644 index 0d472bc25e9..00000000000 --- a/qa/contracts/provider/environments/local.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -module Provider - module Environments - class Local < Base - def initialize - @base_url = ENV['CONTRACT_HOST'] - @merge_request = ENV['CONTRACT_MR'] - end - end - end -end diff --git a/qa/contracts/provider/spec/diffs_helper.rb b/qa/contracts/provider/spec/diffs_helper.rb deleted file mode 100644 index 95dbc4254e6..00000000000 --- a/qa/contracts/provider/spec/diffs_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -require_relative '../spec_helper' - -module Provider - module DiffsHelper - local = Environments::Local.new - - Pact.service_provider "Merge Request Diffs Endpoint" do - app { local.merge_request('/diffs_batch.json?page=0') } - - honours_pact_with 'Merge Request Page' do - pact_uri '../contracts/merge_request_page-merge_request_diffs_endpoint.json' - end - end - end -end diff --git a/qa/contracts/provider/spec/discussions_helper.rb b/qa/contracts/provider/spec/discussions_helper.rb deleted file mode 100644 index 642dde79e1d..00000000000 --- a/qa/contracts/provider/spec/discussions_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -require_relative '../spec_helper' - -module Provider - module DiscussionsHelper - local = Environments::Local.new - - Pact.service_provider "Merge Request Discussions Endpoint" do - app { local.merge_request('/discussions.json') } - - honours_pact_with 'Merge Request Page' do - pact_uri '../contracts/merge_request_page-merge_request_discussions_endpoint.json' - end - end - end -end diff --git a/qa/contracts/provider/spec/metadata_helper.rb b/qa/contracts/provider/spec/metadata_helper.rb deleted file mode 100644 index a3eb4978641..00000000000 --- a/qa/contracts/provider/spec/metadata_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -require_relative '../spec_helper' - -module Provider - module MetadataHelper - local = Environments::Local.new - - Pact.service_provider "Merge Request Metadata Endpoint" do - app { local.merge_request('/diffs_metadata.json') } - - honours_pact_with 'Merge Request Page' do - pact_uri '../contracts/merge_request_page-merge_request_metadata_endpoint.json' - end - end - end -end diff --git a/qa/contracts/provider/spec_helper.rb b/qa/contracts/provider/spec_helper.rb deleted file mode 100644 index 1869c039910..00000000000 --- a/qa/contracts/provider/spec_helper.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module SpecHelper - unless ENV['CONTRACT_HOST'] - raise(ArgumentError, 'Contract tests require CONTRACT_HOST environment variable to be set!') - end - - require_relative '../../../config/bundler_setup' - Bundler.require(:default) - - root = File.expand_path('../', __dir__) - - loader = Zeitwerk::Loader.new - loader.push_dir(root) - - loader.ignore("#{root}/consumer") - loader.ignore("#{root}/contracts") - - loader.collapse("#{root}/provider/spec") - - loader.setup -end |