lib/pact/provider/proxy/tasks/proxy_verification_task.rb in pact-provider-proxy-2.2.0 vs lib/pact/provider/proxy/tasks/proxy_verification_task.rb in pact-provider-proxy-2.3.0
- old
+ new
@@ -7,10 +7,12 @@
def initialize(name)
@pact_spec_configs = []
@provider_base_url = nil
@name = name
+ @publish_verification_results = false
+ @provider_app_version = nil
yield self
rake_task
end
@@ -23,10 +25,18 @@
def provider_base_url url
@provider_base_url = url
end
+ def provider_app_version provider_app_version
+ @provider_app_version = provider_app_version
+ end
+
+ def publish_verification_results publish_verification_results
+ @publish_verification_results = publish_verification_results
+ end
+
private
attr_reader :name
def rake_task
@@ -39,9 +49,11 @@
proxy_pact_helper = File.expand_path('../../proxy_pact_helper.rb', __FILE__)
exit_statuses = pact_spec_configs.collect do | config |
ENV['PACT_PROVIDER_BASE_URL'] = @provider_base_url
ENV['PACT_PROJECT_PACT_HELPER'] = config[:pact_helper]
+ ENV['PACT_PROVIDER_APP_VERSION'] = @provider_app_version
+ ENV['PACT_PUBLISH_VERIFICATION_RESULTS'] = "#{@publish_verification_results}"
Pact::Provider::Proxy::TaskHelper.execute_pact_verify config[:uri], proxy_pact_helper
end
Pact::Provider::Proxy::TaskHelper.handle_verification_failure do
exit_statuses.count{ | status | status != 0 }