pact 1.55.4 → 1.57.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5df3588ab530c1daf855cfe6277e5753d8ca788066951f3e08ef181af615b1d7
4
- data.tar.gz: f13b6198bd1e1383a4dd978ca77bcdc65ee1a60498be14e17bb19ce1622274f5
3
+ metadata.gz: 2f5bff8179ed3588a9363fd864b36527a51672bc2f0812778e188f60571975c1
4
+ data.tar.gz: 8bec6ad8f69b8a60836256c261f32c288624ae1a876e452acedfc62daeffebc8
5
5
  SHA512:
6
- metadata.gz: 476546bb221362d55c77df417d04a9f00a69bedc042ab6aabc059d498dc094f24f810ec25ea3f167ad77e366c4d8fd8d95b473d2d8d74ca5a58027d9d03e0e00
7
- data.tar.gz: 500c176acb2a0f3e4b611b373afc0a868af0ba3bfa8d2082c4e192ffe00b80a4a63a11cadd408d19c28105091b73961c09ce2193d47705a3355b870fa9f777bf
6
+ metadata.gz: a0638972bc29d64815a6d29fbd46a88092eb0d748e21f0da41cde9e485c63fa1158cbf03d9b4d638d273b1caff78470d07d40377be176804fab62e96aecce043
7
+ data.tar.gz: 9161da6d7c9490db14c7472ca54e0c8a0d7a8fdad65f033694a31db8d80097f3a343098fc41f4c12fb59f12a3ae5a36f2b5503ade581eeb1f9c0f8fb66e74920
@@ -1,3 +1,39 @@
1
+ <a name="v1.57.0"></a>
2
+ ### v1.57.0 (2021-01-27)
3
+
4
+ #### Features
5
+
6
+ * allow verbose flag to be set when publishing verifications ([9238e4c](/../../commit/9238e4c))
7
+
8
+ <a name="v1.56.0"></a>
9
+ ### v1.56.0 (2021-01-22)
10
+
11
+ #### Features
12
+
13
+ * catch and log error during help text generation ([182a7cd](/../../commit/182a7cd))
14
+
15
+ <a name="v1.55.7"></a>
16
+ ### v1.55.7 (2020-11-25)
17
+
18
+ #### Bug Fixes
19
+
20
+ * add consumer name to the selection description (#229) ([5127036](/../../commit/5127036))
21
+
22
+ <a name="v1.55.6"></a>
23
+ ### v1.55.6 (2020-11-06)
24
+
25
+ #### Bug Fixes
26
+
27
+ * require rspec now that pact-support does not depend on it ([5b5c27c](/../../commit/5b5c27c))
28
+
29
+ <a name="v1.55.5"></a>
30
+ ### v1.55.5 (2020-10-12)
31
+
32
+ #### Bug Fixes
33
+
34
+ * **security**
35
+ * hide personal access token given in uri (#225) ([f6db12d](/../../commit/f6db12d))
36
+
1
37
  <a name="v1.55.4"></a>
2
38
  ### v1.55.4 (2020-10-09)
3
39
 
@@ -16,6 +16,7 @@ module Pact
16
16
  method_option :pact_broker_password, aliases: "-w", desc: "Pact broker password"
17
17
  method_option :pact_broker_token, aliases: "-k", desc: "Pact broker token"
18
18
  method_option :backtrace, aliases: "-b", desc: "Show full backtrace", :default => false, :type => :boolean
19
+ method_option :verbose, aliases: "-v", desc: "Show verbose HTTP logging", :default => false, :type => :boolean
19
20
  method_option :interactions_replay_order, aliases: "-o",
20
21
  desc: "Interactions replay order: randomised or recorded (default)",
21
22
  default: Pact.configuration.interactions_replay_order
@@ -27,6 +27,7 @@ module Pact
27
27
  # With RSpec3, if the pact_helper loads a library that adds its own formatter before we set one,
28
28
  # we will get a ProgressFormatter too, and get little dots sprinkled throughout our output.
29
29
  # Load a NilFormatter here to prevent that.
30
+ require 'rspec'
30
31
  require 'pact/rspec'
31
32
  ::RSpec.configuration.add_formatter Pact::RSpec.formatter_class.const_get('NilFormatter')
32
33
  end
@@ -78,6 +79,7 @@ module Pact
78
79
  def pact_spec_options
79
80
  {
80
81
  full_backtrace: options[:backtrace],
82
+ verbose: options[:verbose] || ENV['VERBOSE'] == 'true',
81
83
  criteria: SpecCriteria.call(options),
82
84
  format: options[:format],
83
85
  out: options[:out],
@@ -2,14 +2,14 @@ module Pact
2
2
  module PactBroker
3
3
  module PactSelectionDescription
4
4
  def pact_selection_description(provider, consumer_version_selectors, options, broker_base_url)
5
- latest = consumer_version_selectors.any? ? "" : "latest "
6
5
  message = "Fetching pacts for #{provider} from #{broker_base_url} with the selection criteria: "
7
6
  if consumer_version_selectors.any?
8
7
  desc = consumer_version_selectors.collect do |selector|
9
8
  all_or_latest = !selector[:latest] ? "all for tag" : "latest for tag"
9
+ consumer = selector[:consumer] ? "of consumer #{selector[:consumer]}" : nil
10
10
  fallback = selector[:fallback] || selector[:fallbackTag]
11
11
  name = fallback ? "#{selector[:tag]} (or #{fallback} if not found)" : selector[:tag]
12
- "#{all_or_latest} #{name}"
12
+ [all_or_latest, name, consumer].compact.join(" ")
13
13
  end.join(", ")
14
14
  if options[:include_wip_pacts_since]
15
15
  desc = "#{desc}, work in progress pacts created after #{options[:include_wip_pacts_since]}"
@@ -21,6 +21,8 @@ module Pact
21
21
  def call
22
22
  clean_reports_dir
23
23
  write
24
+ rescue StandardError => e
25
+ Pact.configuration.error_stream.puts("ERROR: Error generating help output - #{e.class} #{e.message} \n" + e.backtrace.join("\n"))
24
26
  end
25
27
 
26
28
  private
@@ -75,6 +75,7 @@ module Pact
75
75
  end
76
76
 
77
77
  # For the Pact::Provider::RSpec::PactBrokerFormatter
78
+ Pact.provider_world.verbose = options[:verbose]
78
79
  Pact.provider_world.pact_sources = pact_sources
79
80
  jsons = pact_jsons
80
81
  executing_with_ruby = executing_with_ruby?
@@ -17,7 +17,7 @@ module Pact
17
17
  end
18
18
 
19
19
  def basic_auth?
20
- !!username
20
+ !!username && !!password
21
21
  end
22
22
 
23
23
  def username
@@ -29,12 +29,23 @@ module Pact
29
29
  end
30
30
 
31
31
  def to_s
32
- if basic_auth? && uri.start_with?('http://', 'https://')
32
+ if basic_auth? && http_or_https_uri?
33
33
  URI(@uri).tap { |x| x.userinfo="#{username}:*****"}.to_s
34
+ elsif personal_access_token? && http_or_https_uri?
35
+ URI(@uri).tap { |x| x.userinfo="*****"}.to_s
34
36
  else
35
37
  uri
36
38
  end
37
39
  end
40
+
41
+ private def personal_access_token?
42
+ !!username && !password
43
+ end
44
+
45
+ private def http_or_https_uri?
46
+ uri.start_with?('http://', 'https://')
47
+ end
48
+
38
49
  end
39
50
  end
40
51
  end
@@ -36,7 +36,7 @@ module Pact
36
36
  pact_source: pact_source,
37
37
  consumer_contract: consumer_contract,
38
38
  criteria: options[:criteria]
39
- )
39
+ )
40
40
  end
41
41
  end
42
42
 
@@ -8,7 +8,7 @@ module Pact
8
8
  module RSpec
9
9
  module Matchers
10
10
  module RSpec2Delegator
11
- # For backwards compatiblity with rspec-2
11
+ # For backwards compatibility with rspec-2
12
12
  def method_missing(method, *args, &block)
13
13
  if method_name == :failure_message_for_should
14
14
  failure_message method, *args, &block
@@ -25,7 +25,7 @@ module Pact
25
25
  end
26
26
 
27
27
  def close(_notification)
28
- Pact::Provider::VerificationResults::PublishAll.call(Pact.provider_world.pact_sources, output_hash)
28
+ Pact::Provider::VerificationResults::PublishAll.call(Pact.provider_world.pact_sources, output_hash, { verbose: Pact.provider_world.verbose })
29
29
  end
30
30
 
31
31
  private
@@ -17,15 +17,15 @@ module Pact
17
17
  PROVIDER_RELATION = 'pb:provider'.freeze
18
18
  VERSION_TAG_RELATION = 'pb:version-tag'.freeze
19
19
 
20
- def self.call pact_source, verification_result
21
- new(pact_source, verification_result).call
20
+ def self.call pact_source, verification_result, options = {}
21
+ new(pact_source, verification_result, options).call
22
22
  end
23
23
 
24
- def initialize pact_source, verification_result
24
+ def initialize pact_source, verification_result, options = {}
25
25
  @pact_source = pact_source
26
26
  @verification_result = verification_result
27
27
  http_client_options = pact_source.uri.options.reject{ |k, v| ![:username, :password, :token].include?(k) }
28
- @http_client = Pact::Hal::HttpClient.new(http_client_options)
28
+ @http_client = Pact::Hal::HttpClient.new(http_client_options.merge(verbose: options[:verbose]))
29
29
  @pact_entity = Pact::Hal::Entity.new(pact_source.uri, pact_source.pact_hash, http_client)
30
30
  end
31
31
 
@@ -6,20 +6,21 @@ module Pact
6
6
  module VerificationResults
7
7
  class PublishAll
8
8
 
9
- def self.call pact_sources, test_results_hash
10
- new(pact_sources, test_results_hash).call
9
+ def self.call pact_sources, test_results_hash, options = {}
10
+ new(pact_sources, test_results_hash, options).call
11
11
  end
12
12
 
13
- def initialize pact_sources, test_results_hash
13
+ def initialize pact_sources, test_results_hash, options = {}
14
14
  @pact_sources = pact_sources
15
15
  @test_results_hash = test_results_hash
16
+ @options = options
16
17
  end
17
18
 
18
19
  def call
19
20
  verification_results.collect do | (pact_source, verification_result) |
20
21
  published = false
21
22
  begin
22
- published = Publish.call(pact_source, verification_result)
23
+ published = Publish.call(pact_source, verification_result, { verbose: options[:verbose] })
23
24
  ensure
24
25
  print_after_verification_notices(pact_source, verification_result, published)
25
26
  end
@@ -42,7 +43,7 @@ module Pact
42
43
  end
43
44
  end
44
45
 
45
- attr_reader :pact_sources, :test_results_hash
46
+ attr_reader :pact_sources, :test_results_hash, :options
46
47
  end
47
48
  end
48
49
  end
@@ -14,7 +14,7 @@ module Pact
14
14
  module Provider
15
15
  class World
16
16
 
17
- attr_accessor :pact_sources, :failed_examples
17
+ attr_accessor :pact_sources, :failed_examples, :verbose
18
18
 
19
19
  def provider_states
20
20
  @provider_states_proxy ||= Pact::Provider::State::ProviderStateProxy.new
@@ -1,4 +1,4 @@
1
1
  # Remember to bump pact-provider-proxy when this changes major version
2
2
  module Pact
3
- VERSION = "1.55.4"
3
+ VERSION = "1.57.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.55.4
4
+ version: 1.57.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Fraser
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2020-10-09 00:00:00.000000000 Z
15
+ date: 2021-01-31 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec
@@ -405,7 +405,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
405
405
  - !ruby/object:Gem::Version
406
406
  version: '0'
407
407
  requirements: []
408
- rubygems_version: 3.1.4
408
+ rubygems_version: 3.2.7
409
409
  signing_key:
410
410
  specification_version: 4
411
411
  summary: Enables consumer driven contract testing, providing a mock service and DSL