pact 1.33.0 → 1.33.1

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
  SHA1:
3
- metadata.gz: de02591d62ceb1e65c23c33d8c3ccdb2ccb37a68
4
- data.tar.gz: 5f2d9cf06014c76dc47e918efd5f97472285274d
3
+ metadata.gz: dc6c74058953e4f8516d074b703393ae7b9b9d96
4
+ data.tar.gz: 673ad2646d44b6ef4a2a9c399d14835f8ce29483
5
5
  SHA512:
6
- metadata.gz: e04b4c8dff9d92cdf4f9c46b3570627e851e44d6f024eb231b6353fd2411d49e5959e83a8119dbd05c5c7cb0c392f5dd62a6f33029cf0248c354fe66f6f35184
7
- data.tar.gz: 83c288ddc6c441d4d58f5e36163cab1faa5718d1fd13b73e9c5853f01c66f52408df5e536dd01e52bc5b15787a9376bd9df97e98449fc43a258ad634b9e87e8e
6
+ metadata.gz: 9c9cb0c3734c653ce9fc50c0da20cc23900f0326a8b4d9c0141bd9acfe18eafff7805fd18f1023682a284912f0b8c506f195fcffa407c8ceb197fbc928fc2503
7
+ data.tar.gz: 9e95d8f4550fa62f2eddb542314c35c826b14c64387d9fa6b5d88729827a9a106992922e9a03da1142a773ffd570aa4fd773d85af69bdf8c9dfe7c73eafef1b3
@@ -1,3 +1,20 @@
1
+ <a name="v1.33.1"></a>
2
+ ### v1.33.1 (2018-08-28)
3
+
4
+
5
+ #### Features
6
+
7
+ * rename 'wip pacts' to 'pending pacts' ([6a46ebb](/../../commit/6a46ebb))
8
+
9
+ * **verify cli**
10
+ * rename --wip to --ignore-failures ([8e2dffd](/../../commit/8e2dffd))
11
+
12
+
13
+ #### Bug Fixes
14
+
15
+ * correct version for dependency on pact-mock_service ([01c0df7](/../../commit/01c0df7))
16
+
17
+
1
18
  <a name="v1.33.0"></a>
2
19
  ### v1.33.0 (2018-08-07)
3
20
 
@@ -8,7 +8,7 @@ module Pact
8
8
  desc 'verify', "Verify a pact"
9
9
  method_option :pact_helper, aliases: "-h", desc: "Pact helper file", :required => true
10
10
  method_option :pact_uri, aliases: "-p", desc: "Pact URI"
11
- method_option :wip, type: :boolean, default: false, desc: "If WIP, process will always exit with exit code 0", hide: true
11
+ method_option :ignore_failures, type: :boolean, default: false, desc: "Process will always exit with exit code 0", hide: true
12
12
  method_option :pact_broker_username, aliases: "-u", desc: "Pact broker user name"
13
13
  method_option :pact_broker_password, aliases: "-w", desc: "Pact broker password"
14
14
  method_option :backtrace, aliases: "-b", desc: "Show full backtrace", :default => false, :type => :boolean
@@ -72,7 +72,7 @@ module Pact
72
72
  criteria: SpecCriteria.call(options),
73
73
  format: options[:format],
74
74
  out: options[:out],
75
- wip: options[:wip]
75
+ ignore_failures: options[:ignore_failures]
76
76
  }
77
77
  end
78
78
  end
@@ -36,9 +36,11 @@ module Pact
36
36
  Link.new(@links[key].merge(method: http_method), @client).run(*args)
37
37
  end
38
38
 
39
- def _link(key)
39
+ def _link(key, fallback_key = nil)
40
40
  if @links[key]
41
41
  Link.new(@links[key], @client)
42
+ elsif fallback_key && @links[fallback_key]
43
+ Link.new(@links[fallback_key], @client)
42
44
  else
43
45
  nil
44
46
  end
@@ -1,5 +1,5 @@
1
1
  require 'pact/pact_broker/fetch_pacts'
2
- require 'pact/pact_broker/fetch_wip_pacts'
2
+ require 'pact/pact_broker/fetch_pending_pacts'
3
3
 
4
4
  #
5
5
  # @public Use by Pact Provider Verifier
@@ -12,8 +12,8 @@ module Pact
12
12
  Pact::PactBroker::FetchPacts.call(*args).collect(&:uri)
13
13
  end
14
14
 
15
- def fetch_wip_pact_uris *args
16
- Pact::PactBroker::FetchWipPacts.call(*args).collect(&:uri)
15
+ def fetch_pending_pact_uris *args
16
+ Pact::PactBroker::FetchPendingPacts.call(*args).collect(&:uri)
17
17
  end
18
18
  end
19
19
  end
@@ -4,10 +4,11 @@ require 'pact/provider/pact_uri'
4
4
 
5
5
  module Pact
6
6
  module PactBroker
7
- class FetchWipPacts
7
+ class FetchPendingPacts
8
8
  attr_reader :provider, :tags, :broker_base_url, :http_client_options, :http_client, :index_entity
9
9
 
10
- WIP_PROVIDER_RELATION = 'beta:wip-provider-pacts'.freeze
10
+ PENDING_PROVIDER_RELATION = 'beta:pending-provider-pacts'.freeze
11
+ WIP_PROVIDER_RELATION = 'beta:wip-provider-pacts'.freeze # deprecated
11
12
  PACTS = 'pacts'.freeze
12
13
  PB_PACTS = 'pb:pacts'.freeze
13
14
  HREF = 'href'.freeze
@@ -25,7 +26,7 @@ module Pact
25
26
 
26
27
  def call
27
28
  if index.success?
28
- wip_pacts_for_provider
29
+ pending_pacts_for_provider
29
30
  else
30
31
  raise Pact::Error.new("Error retrieving #{broker_base_url} status=#{index_entity.response.code} #{index_entity.response.raw_body}")
31
32
  end
@@ -37,8 +38,8 @@ module Pact
37
38
  @index_entity ||= Pact::Hal::Link.new({ "href" => broker_base_url }, http_client).get
38
39
  end
39
40
 
40
- def wip_pacts_for_provider
41
- link = index_entity._link(WIP_PROVIDER_RELATION)
41
+ def pending_pacts_for_provider
42
+ link = index_entity._link(WIP_PROVIDER_RELATION, PENDING_PROVIDER_RELATION)
42
43
  if link
43
44
  get_pact_urls(link.expand(provider: provider).get)
44
45
  else
@@ -91,7 +91,7 @@ module Pact
91
91
  ::RSpec::Core::CommandLine.new(NoConfigurationOptions.new)
92
92
  .run(::RSpec.configuration.output_stream, ::RSpec.configuration.error_stream)
93
93
  end
94
- options[:wip] ? 0 : exit_code
94
+ options[:ignore_failures] ? 0 : exit_code
95
95
  end
96
96
 
97
97
  def rspec_runner_options
@@ -120,7 +120,7 @@ module Pact
120
120
  pact_sources.each do | pact_source |
121
121
  options = {
122
122
  criteria: @options[:criteria],
123
- wip: @options[:wip]
123
+ ignore_failures: @options[:ignore_failures]
124
124
  }
125
125
  honour_pactfile pact_source.uri, ordered_pact_json(pact_source.pact_json), options
126
126
  end
@@ -147,7 +147,7 @@ module Pact
147
147
 
148
148
  ::RSpec.configuration.full_backtrace = @options[:full_backtrace]
149
149
 
150
- ::RSpec.configuration.failure_color = :yellow if @options[:wip]
150
+ ::RSpec.configuration.failure_color = :yellow if @options[:ignore_failures]
151
151
  end
152
152
 
153
153
  def ordered_pact_json(pact_json)
@@ -21,7 +21,7 @@ module Pact
21
21
  include ::RSpec::Core::DSL
22
22
 
23
23
  def honour_pactfile pact_uri, pact_json, options
24
- pact_description = options[:wip] ? "WIP pact" : "pact"
24
+ pact_description = options[:ignore_failures] ? "Pending pact" : "pact"
25
25
  Pact.configuration.output_stream.puts "INFO: Reading #{pact_description} at #{pact_uri}"
26
26
  Pact.configuration.output_stream.puts "INFO: Filtering interactions by: #{options[:criteria]}" if options[:criteria] && options[:criteria].any?
27
27
  consumer_contract = Pact::ConsumerContract.from_json(pact_json)
@@ -74,7 +74,7 @@ module Pact
74
74
  pact_interaction: interaction,
75
75
  pact_interaction_example_description: interaction_description_for_rerun_command(interaction),
76
76
  pact_uri: options[:pact_uri],
77
- pact_wip: options[:wip]
77
+ pact_ignore_failures: options[:ignore_failures]
78
78
  }
79
79
 
80
80
  describe description_for(interaction), metadata do
@@ -42,12 +42,12 @@ module Pact
42
42
  summary.failed_examples.collect{ |e| e.metadata[:pact_interaction_example_description] }.uniq.size
43
43
  end
44
44
 
45
- def wip?(summary)
46
- summary.failed_examples.any?{ |e| e.metadata[:pact_wip] }
45
+ def ignore_failures?(summary)
46
+ summary.failed_examples.any?{ |e| e.metadata[:pact_ignore_failures] }
47
47
  end
48
48
 
49
49
  def failure_title summary
50
- if wip?(summary)
50
+ if ignore_failures?(summary)
51
51
  "#{failed_interactions_count(summary)} pending"
52
52
  else
53
53
  ::RSpec::Core::Formatters::Helpers.pluralize(failed_interactions_count(summary), "failure")
@@ -69,7 +69,7 @@ module Pact
69
69
  end
70
70
 
71
71
  def print_rerun_commands summary
72
- if wip?(summary)
72
+ if ignore_failures?(summary)
73
73
  output.puts("\nPending interactions: (Failures listed here are expected and do not affect your suite's status)\n\n")
74
74
  else
75
75
  output.puts("\nFailed interactions:\n\n")
@@ -28,7 +28,7 @@ module Pact
28
28
  command_parts << "-S pact verify"
29
29
  command_parts << "--pact-helper" << Shellwords.escape(pact_helper.end_with?(".rb") ? pact_helper : pact_helper + ".rb")
30
30
  (command_parts << "--pact-uri" << pact_uri) if pact_uri
31
- command_parts << "--wip" if verification_opts[:wip]
31
+ command_parts << "--ignore-failures" if verification_opts[:ignore_failures]
32
32
  command_parts << "--pact-broker-username" << ENV['PACT_BROKER_USERNAME'] if ENV['PACT_BROKER_USERNAME']
33
33
  command_parts << "--pact-broker-password" << ENV['PACT_BROKER_PASSWORD'] if ENV['PACT_BROKER_PASSWORD']
34
34
  command_parts << "--backtrace" if ENV['BACKTRACE'] == 'true'
@@ -30,11 +30,11 @@ module Pact
30
30
 
31
31
  attr_reader :pact_spec_configs
32
32
  attr_accessor :rspec_opts
33
- attr_accessor :wip
33
+ attr_accessor :ignore_failures
34
34
 
35
35
  def initialize(name)
36
36
  @rspec_opts = nil
37
- @wip = false
37
+ @ignore_failures = false
38
38
  @pact_spec_configs = []
39
39
  @name = name
40
40
  yield self
@@ -76,7 +76,7 @@ module Pact
76
76
  require 'pact/tasks/task_helper'
77
77
 
78
78
  exit_statuses = pact_spec_configs.collect do | config |
79
- Pact::TaskHelper.execute_pact_verify config[:uri], config[:pact_helper], rspec_opts, { wip: wip }
79
+ Pact::TaskHelper.execute_pact_verify config[:uri], config[:pact_helper], rspec_opts, { ignore_failures: ignore_failures }
80
80
  end
81
81
 
82
82
  Pact::TaskHelper.handle_verification_failure do
@@ -1,4 +1,4 @@
1
1
  # Remember to bump pact-provider-proxy when this changes major version
2
2
  module Pact
3
- VERSION = "1.33.0"
3
+ VERSION = "1.33.1"
4
4
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem|
29
29
  gem.add_runtime_dependency 'term-ansicolor', '~> 1.0'
30
30
 
31
31
  gem.add_runtime_dependency 'pact-support', '~> 1.7'
32
- gem.add_runtime_dependency 'pact-mock_service', '~> 2.10.0'
32
+ gem.add_runtime_dependency 'pact-mock_service', '~> 2.10'
33
33
 
34
34
  gem.add_development_dependency 'rake', '~> 10.0.3'
35
35
  gem.add_development_dependency 'webmock', '~> 3.0'
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.33.0
4
+ version: 1.33.1
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: 2018-08-06 00:00:00.000000000 Z
15
+ date: 2018-08-28 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: randexp
@@ -138,14 +138,14 @@ dependencies:
138
138
  requirements:
139
139
  - - "~>"
140
140
  - !ruby/object:Gem::Version
141
- version: 2.10.0
141
+ version: '2.10'
142
142
  type: :runtime
143
143
  prerelease: false
144
144
  version_requirements: !ruby/object:Gem::Requirement
145
145
  requirements:
146
146
  - - "~>"
147
147
  - !ruby/object:Gem::Version
148
- version: 2.10.0
148
+ version: '2.10'
149
149
  - !ruby/object:Gem::Dependency
150
150
  name: rake
151
151
  requirement: !ruby/object:Gem::Requirement
@@ -323,7 +323,7 @@ files:
323
323
  - lib/pact/hal/link.rb
324
324
  - lib/pact/pact_broker.rb
325
325
  - lib/pact/pact_broker/fetch_pacts.rb
326
- - lib/pact/pact_broker/fetch_wip_pacts.rb
326
+ - lib/pact/pact_broker/fetch_pending_pacts.rb
327
327
  - lib/pact/project_root.rb
328
328
  - lib/pact/provider.rb
329
329
  - lib/pact/provider/configuration.rb