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 +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/pact/cli.rb +1 -1
- data/lib/pact/cli/run_pact_verification.rb +1 -1
- data/lib/pact/hal/entity.rb +3 -1
- data/lib/pact/pact_broker.rb +3 -3
- data/lib/pact/pact_broker/{fetch_wip_pacts.rb → fetch_pending_pacts.rb} +6 -5
- data/lib/pact/provider/pact_spec_runner.rb +3 -3
- data/lib/pact/provider/rspec.rb +2 -2
- data/lib/pact/provider/rspec/formatter_rspec_3.rb +4 -4
- data/lib/pact/tasks/task_helper.rb +1 -1
- data/lib/pact/tasks/verification_task.rb +3 -3
- data/lib/pact/version.rb +1 -1
- data/pact.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc6c74058953e4f8516d074b703393ae7b9b9d96
|
4
|
+
data.tar.gz: 673ad2646d44b6ef4a2a9c399d14835f8ce29483
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c9cb0c3734c653ce9fc50c0da20cc23900f0326a8b4d9c0141bd9acfe18eafff7805fd18f1023682a284912f0b8c506f195fcffa407c8ceb197fbc928fc2503
|
7
|
+
data.tar.gz: 9e95d8f4550fa62f2eddb542314c35c826b14c64387d9fa6b5d88729827a9a106992922e9a03da1142a773ffd570aa4fd773d85af69bdf8c9dfe7c73eafef1b3
|
data/CHANGELOG.md
CHANGED
@@ -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
|
|
data/lib/pact/cli.rb
CHANGED
@@ -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 :
|
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
|
data/lib/pact/hal/entity.rb
CHANGED
@@ -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
|
data/lib/pact/pact_broker.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'pact/pact_broker/fetch_pacts'
|
2
|
-
require 'pact/pact_broker/
|
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
|
16
|
-
Pact::PactBroker::
|
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
|
7
|
+
class FetchPendingPacts
|
8
8
|
attr_reader :provider, :tags, :broker_base_url, :http_client_options, :http_client, :index_entity
|
9
9
|
|
10
|
-
|
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
|
-
|
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
|
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[:
|
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
|
-
|
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[:
|
150
|
+
::RSpec.configuration.failure_color = :yellow if @options[:ignore_failures]
|
151
151
|
end
|
152
152
|
|
153
153
|
def ordered_pact_json(pact_json)
|
data/lib/pact/provider/rspec.rb
CHANGED
@@ -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[:
|
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
|
-
|
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
|
46
|
-
summary.failed_examples.any?{ |e| e.metadata[:
|
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
|
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
|
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 << "--
|
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 :
|
33
|
+
attr_accessor :ignore_failures
|
34
34
|
|
35
35
|
def initialize(name)
|
36
36
|
@rspec_opts = nil
|
37
|
-
@
|
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, {
|
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
|
data/lib/pact/version.rb
CHANGED
data/pact.gemspec
CHANGED
@@ -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
|
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.
|
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-
|
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
|
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
|
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/
|
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
|