spec: Add list of external pact consumers

Add list of external pact consumers to use when pulling from
external pact broker. The pact.verify rake task fails deep
inside pact code if it can't find a pact file it's expecting.

Change-Id: I61f17d83812a4f5658887b7cf3c0d85fd66d4ae1
Reviewed-on: https://gerrit.instructure.com/158976
Tested-by: Jenkins
Reviewed-by: Anju Reddy <areddy@instructure.com>
Product-Review: Robert Lamb <rlamb@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
This commit is contained in:
Robert Lamb 2018-07-27 14:59:28 -06:00
parent cd99b6d22a
commit ae921cbd24
1 changed files with 10 additions and 2 deletions

View File

@ -17,6 +17,7 @@
#
module PactConfig
EXTERNAL_BROKER_HOST = 'pact-broker.instructure.com'.freeze
# These constants ensure we use the correct strings and thus help avoid our
# accidentally breaking the contract tests
module Providers
@ -29,8 +30,15 @@ module PactConfig
# Add new API and LiveEvents consumers to this Consumers module
module Consumers
GENERIC_CONSUMER = 'Generic Consumer'.freeze
QUIZ_LTI = 'Quiz LTI'.freeze
my_broker_host = ENV.fetch('PACT_BROKER_HOST', 'pact-broker.docker')
if my_broker_host.include?(EXTERNAL_BROKER_HOST)
# extrnal consumers
GENERIC_CONSUMER = 'Generic Consumer'.freeze
else
# internal consumers
GENERIC_CONSUMER = 'Generic Consumer'.freeze
QUIZ_LTI = 'Quiz LTI'.freeze
end
ALL = Consumers.constants.map { |c| Consumers.const_get(c) }.freeze
end