pact 1.55.0 → 1.57.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +65 -0
- data/lib/pact/cli.rb +1 -0
- data/lib/pact/cli/run_pact_verification.rb +2 -0
- data/lib/pact/pact_broker/pact_selection_description.rb +2 -2
- data/lib/pact/provider/help/write.rb +2 -0
- data/lib/pact/provider/pact_source.rb +9 -0
- data/lib/pact/provider/pact_spec_runner.rb +9 -11
- data/lib/pact/provider/pact_uri.rb +13 -2
- data/lib/pact/provider/rspec.rb +6 -8
- data/lib/pact/provider/rspec/calculate_exit_code.rb +18 -0
- data/lib/pact/provider/rspec/formatter_rspec_3.rb +8 -9
- data/lib/pact/provider/rspec/matchers.rb +1 -1
- data/lib/pact/provider/rspec/pact_broker_formatter.rb +1 -1
- data/lib/pact/provider/verification_results/create.rb +17 -13
- data/lib/pact/provider/verification_results/publish.rb +5 -5
- data/lib/pact/provider/verification_results/publish_all.rb +6 -5
- data/lib/pact/provider/world.rb +1 -1
- data/lib/pact/version.rb +1 -1
- data/pact.gemspec +2 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f5bff8179ed3588a9363fd864b36527a51672bc2f0812778e188f60571975c1
|
4
|
+
data.tar.gz: 8bec6ad8f69b8a60836256c261f32c288624ae1a876e452acedfc62daeffebc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0638972bc29d64815a6d29fbd46a88092eb0d748e21f0da41cde9e485c63fa1158cbf03d9b4d638d273b1caff78470d07d40377be176804fab62e96aecce043
|
7
|
+
data.tar.gz: 9161da6d7c9490db14c7472ca54e0c8a0d7a8fdad65f033694a31db8d80097f3a343098fc41f4c12fb59f12a3ae5a36f2b5503ade581eeb1f9c0f8fb66e74920
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,68 @@
|
|
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
|
+
|
37
|
+
<a name="v1.55.4"></a>
|
38
|
+
### v1.55.4 (2020-10-09)
|
39
|
+
|
40
|
+
#### Bug Fixes
|
41
|
+
|
42
|
+
* add back missing output describing the interactions filter ([1a2d7c1](/../../commit/1a2d7c1))
|
43
|
+
|
44
|
+
<a name="v1.55.3"></a>
|
45
|
+
### v1.55.3 (2020-09-28)
|
46
|
+
|
47
|
+
#### Bug Fixes
|
48
|
+
|
49
|
+
* correct logic for determining if all interactions for a pact have been verified ([c4f968e](/../../commit/c4f968e))
|
50
|
+
* de-duplicate re-run commands ([0813498](/../../commit/0813498))
|
51
|
+
|
52
|
+
<a name="v1.55.2"></a>
|
53
|
+
### v1.55.2 (2020-09-26)
|
54
|
+
|
55
|
+
#### Bug Fixes
|
56
|
+
|
57
|
+
* correctly calculate exit code when a mix of pending and non pending pacts are verified ([533faa1](/../../commit/533faa1))
|
58
|
+
|
59
|
+
<a name="v1.55.1"></a>
|
60
|
+
### v1.55.1 (2020-09-26)
|
61
|
+
|
62
|
+
#### Bug Fixes
|
63
|
+
|
64
|
+
* remove accidentally committed debug logging ([081423e](/../../commit/081423e))
|
65
|
+
|
1
66
|
<a name="v1.55.0"></a>
|
2
67
|
### v1.55.0 (2020-09-26)
|
3
68
|
|
data/lib/pact/cli.rb
CHANGED
@@ -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
|
-
|
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]}"
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'pact/consumer_contract/pact_file'
|
2
2
|
require 'pact/hal/http_client'
|
3
3
|
require 'pact/hal/entity'
|
4
|
+
require 'pact/consumer_contract'
|
4
5
|
|
5
6
|
module Pact
|
6
7
|
module Provider
|
@@ -20,6 +21,14 @@ module Pact
|
|
20
21
|
@pact_hash ||= JSON.load(pact_json, nil, { max_nesting: 50 })
|
21
22
|
end
|
22
23
|
|
24
|
+
def pending?
|
25
|
+
uri.metadata[:pending]
|
26
|
+
end
|
27
|
+
|
28
|
+
def consumer_contract
|
29
|
+
@consumer_contract ||= Pact::ConsumerContract.from_json(pact_json)
|
30
|
+
end
|
31
|
+
|
23
32
|
def hal_entity
|
24
33
|
http_client_keys = [:username, :password, :token]
|
25
34
|
http_client_options = uri.options.reject{ |k, _| !http_client_keys.include?(k) }
|
@@ -11,6 +11,7 @@ require 'pact/provider/verification_results/publish_all'
|
|
11
11
|
require 'pact/provider/rspec/pact_broker_formatter'
|
12
12
|
require 'pact/provider/rspec/json_formatter'
|
13
13
|
require 'pact/provider/rspec'
|
14
|
+
require 'pact/provider/rspec/calculate_exit_code'
|
14
15
|
|
15
16
|
module Pact
|
16
17
|
module Provider
|
@@ -74,11 +75,13 @@ module Pact
|
|
74
75
|
end
|
75
76
|
|
76
77
|
# For the Pact::Provider::RSpec::PactBrokerFormatter
|
78
|
+
Pact.provider_world.verbose = options[:verbose]
|
77
79
|
Pact.provider_world.pact_sources = pact_sources
|
78
80
|
jsons = pact_jsons
|
79
81
|
executing_with_ruby = executing_with_ruby?
|
80
82
|
|
81
83
|
config.after(:suite) do | suite |
|
84
|
+
Pact.provider_world.failed_examples = suite.reporter.failed_examples
|
82
85
|
Pact::Provider::Help::Write.call(Pact.provider_world.pact_sources) if executing_with_ruby
|
83
86
|
end
|
84
87
|
end
|
@@ -90,7 +93,12 @@ module Pact
|
|
90
93
|
::RSpec::Core::CommandLine.new(NoConfigurationOptions.new)
|
91
94
|
.run(::RSpec.configuration.output_stream, ::RSpec.configuration.error_stream)
|
92
95
|
end
|
93
|
-
|
96
|
+
|
97
|
+
if options[:ignore_failures]
|
98
|
+
0
|
99
|
+
else
|
100
|
+
Pact::Provider::RSpec::CalculateExitCode.call(pact_sources, Pact.provider_world.failed_examples)
|
101
|
+
end
|
94
102
|
end
|
95
103
|
|
96
104
|
def rspec_runner_options
|
@@ -147,8 +155,6 @@ module Pact
|
|
147
155
|
end
|
148
156
|
|
149
157
|
::RSpec.configuration.full_backtrace = @options[:full_backtrace]
|
150
|
-
|
151
|
-
::RSpec.configuration.failure_color = :yellow if pending_mode?
|
152
158
|
end
|
153
159
|
|
154
160
|
def ordered_pact_json(pact_json)
|
@@ -159,20 +165,12 @@ module Pact
|
|
159
165
|
consumer_contract.to_json
|
160
166
|
end
|
161
167
|
|
162
|
-
def all_pacts_pending?
|
163
|
-
pact_urls.all?{ | pact_url| pact_url.metadata[:pending] }
|
164
|
-
end
|
165
|
-
|
166
168
|
def class_exists? name
|
167
169
|
Kernel.const_get name
|
168
170
|
rescue NameError
|
169
171
|
false
|
170
172
|
end
|
171
173
|
|
172
|
-
def pending_mode?
|
173
|
-
(all_pacts_pending? || options[:ignore_failures])
|
174
|
-
end
|
175
|
-
|
176
174
|
def executing_with_ruby?
|
177
175
|
ENV['PACT_EXECUTING_LANGUAGE'] == 'ruby'
|
178
176
|
end
|
@@ -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? &&
|
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
|
data/lib/pact/provider/rspec.rb
CHANGED
@@ -26,15 +26,17 @@ module Pact
|
|
26
26
|
Pact.configuration.output_stream.puts "INFO: Reading pact at #{pact_uri}"
|
27
27
|
consumer_contract = Pact::ConsumerContract.from_json(pact_json)
|
28
28
|
suffix = pact_uri.metadata[:pending] ? " [PENDING]": ""
|
29
|
+
example_group_description = "Verifying a pact between #{consumer_contract.consumer.name} and #{consumer_contract.provider.name}#{suffix}"
|
30
|
+
example_group_metadata = { pactfile_uri: pact_uri, pact_criteria: options[:criteria] }
|
29
31
|
|
30
|
-
::RSpec.describe
|
32
|
+
::RSpec.describe example_group_description, example_group_metadata do
|
31
33
|
honour_consumer_contract consumer_contract, options.merge(
|
32
34
|
pact_json: pact_json,
|
33
35
|
pact_uri: pact_uri,
|
34
36
|
pact_source: pact_source,
|
35
37
|
consumer_contract: consumer_contract,
|
36
38
|
criteria: options[:criteria]
|
37
|
-
|
39
|
+
)
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
@@ -89,9 +91,8 @@ module Pact
|
|
89
91
|
pact_interaction_example_description: interaction_description_for_rerun_command(interaction),
|
90
92
|
pact_uri: options[:pact_uri],
|
91
93
|
pact_source: options[:pact_source],
|
92
|
-
pact_ignore_failures: options[:
|
93
|
-
pact_consumer_contract: options[:consumer_contract]
|
94
|
-
pact_criteria: options[:criteria]
|
94
|
+
pact_ignore_failures: options[:pact_source].pending? || options[:ignore_failures],
|
95
|
+
pact_consumer_contract: options[:consumer_contract]
|
95
96
|
}
|
96
97
|
|
97
98
|
describe description_for(interaction), metadata do
|
@@ -100,9 +101,6 @@ module Pact
|
|
100
101
|
pact_context = options[:pact_context]
|
101
102
|
|
102
103
|
before do | example |
|
103
|
-
pact_context.run_once :before do
|
104
|
-
::RSpec.configuration.reporter.message "THIS IS A PACT"
|
105
|
-
end
|
106
104
|
interaction_context.run_once :before do
|
107
105
|
Pact.configuration.logger.info "Running example '#{Pact::RSpec.full_description(example)}'"
|
108
106
|
set_up_provider_states interaction.provider_states, options[:consumer]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Pact
|
2
|
+
module Provider
|
3
|
+
module RSpec
|
4
|
+
module CalculateExitCode
|
5
|
+
def self.call(pact_sources, failed_examples)
|
6
|
+
any_non_pending_failures = pact_sources.any? do |pact_source|
|
7
|
+
if pact_source.pending?
|
8
|
+
nil
|
9
|
+
else
|
10
|
+
failed_examples.select { |e| e.metadata[:pact_source] == pact_source }.any?
|
11
|
+
end
|
12
|
+
end
|
13
|
+
any_non_pending_failures ? 1 : 0
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -25,6 +25,7 @@ module Pact
|
|
25
25
|
C = ::Term::ANSIColor
|
26
26
|
|
27
27
|
def example_group_started(notification)
|
28
|
+
# This is the metadata on the top level "Verifying a pact between X and Y" describe block
|
28
29
|
if @group_level == 0
|
29
30
|
Pact.configuration.output_stream.puts
|
30
31
|
pact_uri = notification.group.metadata[:pactfile_uri]
|
@@ -65,10 +66,6 @@ module Pact
|
|
65
66
|
pending_interaction_examples(summary).size
|
66
67
|
end
|
67
68
|
|
68
|
-
def ignore_failures?(summary)
|
69
|
-
summary.failed_examples.any?{ |e| e.metadata[:pact_ignore_failures] }
|
70
|
-
end
|
71
|
-
|
72
69
|
def failure_title summary
|
73
70
|
::RSpec::Core::Formatters::Helpers.pluralize(failed_interactions_count(summary), "failure")
|
74
71
|
end
|
@@ -96,12 +93,14 @@ module Pact
|
|
96
93
|
interaction_rerun_commands(pending_interaction_examples(summary)).each do | message |
|
97
94
|
output.puts(message)
|
98
95
|
end
|
96
|
+
set_rspec_failure_color(:red)
|
99
97
|
end
|
100
98
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
99
|
+
if failed_interactions_count(summary) > 0
|
100
|
+
output.puts("\nFailed interactions:\n\n")
|
101
|
+
interaction_rerun_commands(failed_interaction_examples(summary)).each do | message |
|
102
|
+
output.puts(message)
|
103
|
+
end
|
105
104
|
end
|
106
105
|
end
|
107
106
|
|
@@ -130,7 +129,7 @@ module Pact
|
|
130
129
|
def interaction_rerun_commands examples
|
131
130
|
examples.collect do |example|
|
132
131
|
interaction_rerun_command_for example
|
133
|
-
end.compact
|
132
|
+
end.compact.uniq
|
134
133
|
end
|
135
134
|
|
136
135
|
def interaction_unique_key(example)
|
@@ -8,7 +8,7 @@ module Pact
|
|
8
8
|
module RSpec
|
9
9
|
module Matchers
|
10
10
|
module RSpec2Delegator
|
11
|
-
# For backwards
|
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
|
@@ -28,7 +28,23 @@ module Pact
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def publishable?
|
31
|
-
|
31
|
+
if defined?(@publishable)
|
32
|
+
@publishable
|
33
|
+
else
|
34
|
+
@publishable = pact_source.consumer_contract.interactions.all? do | interaction |
|
35
|
+
examples_for_pact_uri.any?{ |e| example_is_for_interaction?(e, interaction) }
|
36
|
+
end && examples_for_pact_uri.count > 0
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def example_is_for_interaction?(example, interaction)
|
41
|
+
# Use the Pact Broker id if supported
|
42
|
+
if interaction._id
|
43
|
+
example[:pact_interaction]._id == interaction._id
|
44
|
+
else
|
45
|
+
# fall back to object equality (based on the field values of the interaction)
|
46
|
+
example[:pact_interaction] == interaction
|
47
|
+
end
|
32
48
|
end
|
33
49
|
|
34
50
|
def examples_for_pact_uri
|
@@ -39,18 +55,6 @@ module Pact
|
|
39
55
|
examples_for_pact_uri.count{ |e| e[:status] != 'passed' }
|
40
56
|
end
|
41
57
|
|
42
|
-
def executed_interactions_count
|
43
|
-
examples_for_pact_uri
|
44
|
-
.collect { |e| e[:pact_interaction].object_id }
|
45
|
-
.uniq
|
46
|
-
.count
|
47
|
-
end
|
48
|
-
|
49
|
-
def all_interactions_count
|
50
|
-
interactions = (pact_source.pact_hash['interactions'] || pact_source.pact_hash['messages'])
|
51
|
-
interactions ? interactions.count : 0
|
52
|
-
end
|
53
|
-
|
54
58
|
def test_results_hash_for_pact_uri
|
55
59
|
{
|
56
60
|
tests: examples_for_pact_uri.collect{ |e| clean_example(e) },
|
@@ -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
|
|
@@ -81,7 +81,7 @@ module Pact
|
|
81
81
|
Pact.configuration.output_stream.puts "INFO: Tagging version #{provider_application_version} of #{provider_name} as #{tag.inspect}"
|
82
82
|
tag_entity = tag_link.expand(version: provider_application_version, tag: tag).put
|
83
83
|
unless tag_entity.success?
|
84
|
-
raise PublicationError.new("Error returned from tagging request
|
84
|
+
raise PublicationError.new("Error returned from tagging request: status=#{tag_entity.response.code} body=#{tag_entity.response.body}")
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|
@@ -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
|
data/lib/pact/provider/world.rb
CHANGED
data/lib/pact/version.rb
CHANGED
data/pact.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |gem|
|
|
32
32
|
gem.add_runtime_dependency 'webrick', '~> 1.3'
|
33
33
|
gem.add_runtime_dependency 'term-ansicolor', '~> 1.0'
|
34
34
|
|
35
|
-
gem.add_runtime_dependency 'pact-support', '~> 1.
|
35
|
+
gem.add_runtime_dependency 'pact-support', '~> 1.15'
|
36
36
|
gem.add_runtime_dependency 'pact-mock_service', '~> 3.0', '>= 3.3.1'
|
37
37
|
|
38
38
|
gem.add_development_dependency 'rake', '~> 13.0'
|
@@ -43,6 +43,6 @@ Gem::Specification.new do |gem|
|
|
43
43
|
gem.add_development_dependency 'faraday', '~> 0.13'
|
44
44
|
gem.add_development_dependency 'conventional-changelog', '~> 1.3'
|
45
45
|
gem.add_development_dependency 'bump', '~> 0.5'
|
46
|
-
gem.add_development_dependency 'pact-message', '~> 0.
|
46
|
+
gem.add_development_dependency 'pact-message', '~> 0.8'
|
47
47
|
gem.add_development_dependency 'rspec-its', '~> 1.3'
|
48
48
|
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.
|
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:
|
15
|
+
date: 2021-01-31 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rspec
|
@@ -102,14 +102,14 @@ dependencies:
|
|
102
102
|
requirements:
|
103
103
|
- - "~>"
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: '1.
|
105
|
+
version: '1.15'
|
106
106
|
type: :runtime
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - "~>"
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: '1.
|
112
|
+
version: '1.15'
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: pact-mock_service
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
@@ -248,14 +248,14 @@ dependencies:
|
|
248
248
|
requirements:
|
249
249
|
- - "~>"
|
250
250
|
- !ruby/object:Gem::Version
|
251
|
-
version: '0.
|
251
|
+
version: '0.8'
|
252
252
|
type: :development
|
253
253
|
prerelease: false
|
254
254
|
version_requirements: !ruby/object:Gem::Requirement
|
255
255
|
requirements:
|
256
256
|
- - "~>"
|
257
257
|
- !ruby/object:Gem::Version
|
258
|
-
version: '0.
|
258
|
+
version: '0.8'
|
259
259
|
- !ruby/object:Gem::Dependency
|
260
260
|
name: rspec-its
|
261
261
|
requirement: !ruby/object:Gem::Requirement
|
@@ -352,6 +352,7 @@ files:
|
|
352
352
|
- lib/pact/provider/request.rb
|
353
353
|
- lib/pact/provider/rspec.rb
|
354
354
|
- lib/pact/provider/rspec/backtrace_formatter.rb
|
355
|
+
- lib/pact/provider/rspec/calculate_exit_code.rb
|
355
356
|
- lib/pact/provider/rspec/custom_options_file
|
356
357
|
- lib/pact/provider/rspec/formatter_rspec_2.rb
|
357
358
|
- lib/pact/provider/rspec/formatter_rspec_3.rb
|
@@ -404,7 +405,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
404
405
|
- !ruby/object:Gem::Version
|
405
406
|
version: '0'
|
406
407
|
requirements: []
|
407
|
-
rubygems_version: 3.
|
408
|
+
rubygems_version: 3.2.7
|
408
409
|
signing_key:
|
409
410
|
specification_version: 4
|
410
411
|
summary: Enables consumer driven contract testing, providing a mock service and DSL
|