pact-provider-verifier 1.29.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63532bb1b371a5f8fa5ea69e5393eaab586a49183799d01713cde4ad06737152
4
- data.tar.gz: a638f33f5391338163da93202a4bf994e374f39cb930838b5ca54870618f7684
3
+ metadata.gz: eff9b2a71c6f40e45953272878aa7ebb258bd185033401f6a4e9c3fc6e1af02b
4
+ data.tar.gz: 78eeba2766a964d9adfd07ed49e58691e6a55964bb3a908b4ac3c23d7632f939
5
5
  SHA512:
6
- metadata.gz: c1bc90f19b67c6dc051c43088ff736554d02990a1ea4abea5b965d0d3f388c2fe7773acb312c572e0e51b2047878ee31e93f0715621e708e36f82ca9ff9743ed
7
- data.tar.gz: 6ae247c50649cd281331b848fcf3c2e3be93bf6328154904778c8e355dffda704b58bb0ae70da115b91861a90e836add5104ef730db48995056d2029cc92eff0
6
+ metadata.gz: f634377b978faadc856ca664c65276fc6a0e656b92bc92d85bd337096000b28dc2cfc3de269fa6e872592533391c1ba51e0646b8c8c4c1d6739215b602c0d1d6
7
+ data.tar.gz: 45d8857e5dee13d48abf1d8391acd8ae1b277dd733c9e748f693b2df006246b18e9be856526f4045e2c3042e80229f304814281e51c5b211d66f0373e72eee93
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ <a name="v1.30.0-1"></a>
2
+ ### v1.30.0-1 (2020-02-19)
3
+
4
+
5
+ #### Features
6
+
7
+ * **cli**
8
+ * add --include-wip-pacts-since (hidden until publicly released) ([3109ce2](/../../commit/3109ce2))
9
+
10
+
1
11
  <a name="v1.29.0-1"></a>
2
12
  ### v1.29.0-1 (2020-02-18)
3
13
 
@@ -57,7 +57,10 @@ module Pact
57
57
  end
58
58
 
59
59
  def pact_options
60
- { include_pending_status: options[:enable_pending] }
60
+ {
61
+ include_pending_status: options[:enable_pending],
62
+ include_wip_pacts_since: options[:include_wip_pacts_since]
63
+ }
61
64
  end
62
65
  end
63
66
  end
@@ -190,6 +190,10 @@ module Pact
190
190
  token: options.broker_token || ENV['PACT_BROKER_TOKEN'],
191
191
  verbose: options.verbose
192
192
  }
193
+ opts = {
194
+ enable_pending: options.enable_pending,
195
+ include_wip_pacts_since: options.include_wip_pacts_since
196
+ }
193
197
  AggregatePactConfigs.call(
194
198
  pact_urls,
195
199
  options.provider,
@@ -198,8 +202,7 @@ module Pact
198
202
  provider_version_tags,
199
203
  options.pact_broker_base_url || ENV['PACT_BROKER_BASE_URL'],
200
204
  http_client_options,
201
- { enable_pending: options.enable_pending }
202
- )
205
+ opts)
203
206
  end
204
207
 
205
208
  def require_pact_project_pact_helper
@@ -32,12 +32,13 @@ module Pact
32
32
  method_option :broker_token, aliases: "-k", desc: "Pact Broker bearer token. Can also be set using the environment variable PACT_BROKER_TOKEN.", :required => false
33
33
  method_option :provider, required: false
34
34
  method_option :consumer_version_tag, type: :array, banner: "TAG", desc: "Retrieve the latest pacts with this consumer version tag. Used in conjunction with --provider. May be specified multiple times.", :required => false
35
- method_option :consumer_version_selector, type: :array, banner: "SELECTOR", desc: "JSON string specifying a selector that identifies which pacts to verify. May be specified multiple times. See below for further documentation.", :required => false
35
+ method_option :consumer_version_selector, hide: true, type: :array, banner: "SELECTOR", desc: "JSON string specifying a selector that identifies which pacts to verify. May be specified multiple times. See below for further documentation.", :required => false
36
36
  method_option :provider_version_tag, type: :array, banner: "TAG", desc: "Tag to apply to the provider application version. May be specified multiple times.", :required => false
37
37
  method_option :tag_with_git_branch, aliases: "-g", type: :boolean, default: false, required: false, desc: "Tag provider version with the name of the current git branch. Default: false"
38
38
  method_option :provider_app_version, aliases: "-a", desc: "Provider application version, required when publishing verification results", :required => false
39
39
  method_option :publish_verification_results, aliases: "-r", desc: "Publish verification results to the broker. This can also be enabled by setting the environment variable PACT_BROKER_PUBLISH_VERIFICATION_RESULTS=true", required: false, type: :boolean, default: false
40
- method_option :enable_pending, desc: "Allow pacts which are in pending state to be verified without causing the overall task to fail. For more information, see https://pact.io/pending", required: false, type: :boolean, default: false
40
+ method_option :enable_pending, hide: true, desc: "Allow pacts which are in pending state to be verified without causing the overall task to fail. For more information, see https://pact.io/pending", required: false, type: :boolean, default: false
41
+ method_option :include_wip_pacts_since, desc: "", hide: true
41
42
  method_option :custom_provider_header, type: :array, banner: 'CUSTOM_PROVIDER_HEADER', desc: "Header to add to provider state set up and pact verification requests. eg 'Authorization: Basic cGFjdDpwYWN0'. May be specified multiple times.", :required => false
42
43
  method_option :custom_middleware, type: :array, banner: 'FILE', desc: "Ruby file containing a class implementing Pact::ProviderVerifier::CustomMiddleware. This allows the response to be modified before replaying. Use with caution!", :required => false
43
44
  method_option :monkeypatch, hide: true, type: :array, :required => false
@@ -50,7 +51,6 @@ module Pact
50
51
  method_option :wait, banner: "SECONDS", required: false, type: :numeric, desc: "The number of seconds to poll for the provider to become available before running the verification", default: 0
51
52
 
52
53
  def verify(*pact_urls)
53
- validate_credentials
54
54
  validate_verify
55
55
  print_deprecation_warnings
56
56
  success = Pact::ProviderVerifier::App.call(merged_urls(pact_urls), options)
@@ -77,17 +77,31 @@ module Pact
77
77
  end
78
78
  end
79
79
 
80
+ def validate_verify
81
+ if options.pact_broker_base_url && (options.provider.nil? || options.provider == "")
82
+ raise InvalidArgumentsError, "No value provided for required option '--provider'"
83
+ end
84
+ validate_consumer_version_selectors
85
+ validate_wip_since_date
86
+ validate_credentials
87
+ end
88
+
80
89
  def validate_credentials
81
90
  if (options.broker_username || ENV['PACT_BROKER_USERNAME']) && (options.broker_token || ENV['PACT_BROKER_TOKEN'])
82
91
  raise AuthError, "You cannot provide both a username/password and a bearer token. If your Pact Broker uses a bearer token, please remove the username and password configuration."
83
92
  end
84
93
  end
85
94
 
86
- def validate_verify
87
- if options.pact_broker_base_url && (options.provider.nil? || options.provider == "")
88
- raise InvalidArgumentsError, "No value provided for required option '--provider'"
95
+ def validate_wip_since_date
96
+ require 'date'
97
+
98
+ if options.include_wip_pacts_since
99
+ begin
100
+ DateTime.parse(options.include_wip_pacts_since)
101
+ rescue ArgumentError
102
+ raise InvalidArgumentsError, "The value provided for --include-wip-pacts-since could not be parsed to a DateTime. Please provide a value in the format %Y-%m-%d or %Y-%m-%dT%H:%M:%S.000%:z"
103
+ end
89
104
  end
90
- validate_consumer_version_selectors
91
105
  end
92
106
 
93
107
  def validate_consumer_version_selectors
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module ProviderVerifier
3
- VERSION = "1.29.0"
3
+ VERSION = "1.30.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-provider-verifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.29.0
4
+ version: 1.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Fellows
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-18 00:00:00.000000000 Z
12
+ date: 2020-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -31,20 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '1.46'
35
- - - ">="
36
- - !ruby/object:Gem::Version
37
- version: 1.46.1
34
+ version: '1.49'
38
35
  type: :runtime
39
36
  prerelease: false
40
37
  version_requirements: !ruby/object:Gem::Requirement
41
38
  requirements:
42
39
  - - "~>"
43
40
  - !ruby/object:Gem::Version
44
- version: '1.46'
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 1.46.1
41
+ version: '1.49'
48
42
  - !ruby/object:Gem::Dependency
49
43
  name: pact-message
50
44
  requirement: !ruby/object:Gem::Requirement