pact-provider-verifier 1.30.1 → 1.31.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: '099c188a928486e7a91e529fb8dfa2b45535b9339402840e2743525622df8d74'
4
- data.tar.gz: ed7c66ffae90698d5425dd89581a25436e4a5117110d01258570f53784577dc0
3
+ metadata.gz: 44c17f0743c806ca23c26957d6011ed92fa7374cf25c2077e2d8fac967695d97
4
+ data.tar.gz: edd33bd8d49c5a74fb5ddac57f71cd9639963d207a24efe52638d0242a567c2c
5
5
  SHA512:
6
- metadata.gz: 9890c13f0c7e63dbe61cdec01fbade7936d8a775ef0a0b85ae741990b8ca085813a9f019065d3e69549b2827e440cbf2f46f9cd66b0e68d52203052e1080babc
7
- data.tar.gz: a9450e4732f8a0a39bdfd74baa17331dd559a35ace0663e8b41f915f43fd3c5429361ae121f57ed24d69d03e0944cbd8b0270990aac53e0337b6f67971bc34c5
6
+ metadata.gz: 5e651daba957e5270412987777d03b253b54e662ee2205085f62a090eaaa405ab8fa6ecfc50db986365cbf35146c5f6568c4abb7d923f4146d9614e172eece82
7
+ data.tar.gz: d325e9aca5995fe88bba89b7fc6cd10e4a858a3c5cd3d540ae5e9b03b78454ad80d5ea6b46142cfbaa797c5ce7a59e77863e64773719b4a173ffad2bc2ab6031
@@ -1,3 +1,12 @@
1
+ <a name="v1.31.0-1"></a>
2
+ ### v1.31.0-1 (2020-06-23)
3
+
4
+
5
+ #### Features
6
+
7
+ * add --log-dir and --log-level to CLI ([1cf71bb](/../../commit/1cf71bb))
8
+
9
+
1
10
  <a name="v1.30.1-1"></a>
2
11
  ### v1.30.1-1 (2020-04-22)
3
12
 
data/README.md CHANGED
@@ -41,55 +41,53 @@ Usage:
41
41
 
42
42
  Options:
43
43
  -h, --provider-base-url=PROVIDER_BASE_URL
44
- # Provider host URL
44
+ # Provider host URL
45
45
  -c, [--provider-states-setup-url=PROVIDER_STATES_SETUP_URL]
46
- # Base URL to setup the provider states at
46
+ # Base URL to setup the provider states at
47
47
  [--pact-broker-base-url=PACT_BROKER_BASE_URL]
48
- # Base URL of the Pact Broker from which to retrieve the pacts. Can also be set using the environment variable PACT_BROKER_BASE_URL.
48
+ # Base URL of the Pact Broker from which to retrieve the pacts. Can also be set using the environment variable PACT_BROKER_BASE_URL.
49
49
  -n, [--broker-username=BROKER_USERNAME]
50
- # Pact Broker basic auth username. Can also be set using the environment variable PACT_BROKER_USERNAME.
50
+ # Pact Broker basic auth username. Can also be set using the environment variable PACT_BROKER_USERNAME.
51
51
  -p, [--broker-password=BROKER_PASSWORD]
52
- # Pact Broker basic auth password. Can also be set using the environment variable PACT_BROKER_PASSWORD.
52
+ # Pact Broker basic auth password. Can also be set using the environment variable PACT_BROKER_PASSWORD.
53
53
  -k, [--broker-token=BROKER_TOKEN]
54
- # Pact Broker bearer token. Can also be set using the environment variable PACT_BROKER_TOKEN.
54
+ # Pact Broker bearer token. Can also be set using the environment variable PACT_BROKER_TOKEN.
55
55
  [--provider=PROVIDER]
56
56
  [--consumer-version-tag=TAG]
57
- # Retrieve the latest pacts with this consumer version tag. Used in conjunction with --provider. May be specified multiple times.
58
- [--consumer-version-selector=SELECTOR]
59
- # JSON string specifying a selector that identifies which pacts to verify. May be specified multiple times. See below for further documentation.
57
+ # Retrieve the latest pacts with this consumer version tag. Used in conjunction with --provider. May be specified multiple times.
60
58
  [--provider-version-tag=TAG]
61
- # Tag to apply to the provider application version. May be specified multiple times.
59
+ # Tag to apply to the provider application version. May be specified multiple times.
60
+ -g, [--tag-with-git-branch], [--no-tag-with-git-branch]
61
+ # Tag provider version with the name of the current git branch. Default: false
62
62
  -a, [--provider-app-version=PROVIDER_APP_VERSION]
63
- # Provider application version, required when publishing verification results
63
+ # Provider application version, required when publishing verification results
64
64
  -r, [--publish-verification-results], [--no-publish-verification-results]
65
- # Publish verification results to the broker. This can also be enabled by setting the environment variable PACT_BROKER_PUBLISH_VERIFICATION_RESULTS=true
66
- [--enable-pending], [--no-enable-pending]
67
- # 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
65
+ # Publish verification results to the broker. This can also be enabled by setting the environment variable PACT_BROKER_PUBLISH_VERIFICATION_RESULTS=true
68
66
  [--custom-provider-header=CUSTOM_PROVIDER_HEADER]
69
- # Header to add to provider state set up and pact verification requests. eg 'Authorization: Basic cGFjdDpwYWN0'. May be specified multiple times.
67
+ # Header to add to provider state set up and pact verification requests. eg 'Authorization: Basic cGFjdDpwYWN0'. May be specified multiple times.
70
68
  [--custom-middleware=FILE]
71
- # Ruby file containing a class implementing Pact::ProviderVerifier::CustomMiddleware. This allows the response to be modified before replaying. Use with caution!
69
+ # Ruby file containing a class implementing Pact::ProviderVerifier::CustomMiddleware. This allows the response to be modified before replaying. Use with caution!
72
70
  -v, [--verbose=VERBOSE]
73
- # Verbose output
71
+ # Verbose output
74
72
  -f, [--format=FORMATTER]
75
- # RSpec formatter. Defaults to custom Pact formatter. Other options are json and RspecJunitFormatter (which outputs xml).
73
+ # RSpec formatter. Defaults to custom Pact formatter. Other options are json and RspecJunitFormatter (which outputs xml).
76
74
  -o, [--out=FILE]
77
- # Write output to a file instead of $stdout.
75
+ # Write output to a file instead of $stdout.
78
76
  [--wait=SECONDS]
79
- # The number of seconds to poll for the provider to become available before running the verification
77
+ # The number of seconds to poll for the provider to become available before running the verification
80
78
 
81
- # Default: 0
79
+ # Default: 0
82
80
 
83
81
  Description:
84
- To verify a pact from a known URL, specify one or more PACT_URL arguments. If the pact
85
- is hosted in a Pact Broker that uses authentication, specify the relevant
82
+ To verify a pact from a known URL, specify one or more PACT_URL arguments. If the
83
+ pact is hosted in a Pact Broker that uses authentication, specify the relevant
86
84
  --broker-username/--broker-password or --broker-token fields. To dynamically fetch
87
85
  pacts from a Pact Broker based on the provider name, specify the
88
86
  --pact-broker-base-url, --provider and relevant authentication fields.
89
87
 
90
- Selectors: These are specified using JSON strings. The keys are 'tag' (the name of the consumer
91
- version tag) and 'latest' (true|false). For example '{"tag": "master", "latest":
92
- true}'. For a detailed explanation of selectors, see https://pact.io/selectors
88
+ Selectors: These are specified using JSON strings. The keys are 'tag' (the name of the
89
+ consumer version tag) and 'latest' (true|false). For example '{"tag": "master",
90
+ "latest": true}'. For a detailed explanation of selectors, see
93
91
  ```
94
92
 
95
93
  ## Examples
@@ -97,6 +97,8 @@ module Pact
97
97
  require 'pact/configuration'
98
98
  Pact.configuration.output_stream = Pact.configuration.error_stream
99
99
  end
100
+ Pact.configuration.log_dir = options.log_dir if options.log_dir
101
+ Pact.configuration.logger.level = Kernel.const_get('Logger').const_get(options.log_level.upcase) if options.log_level
100
102
  end
101
103
 
102
104
  def configure_reverse_proxy
@@ -49,6 +49,8 @@ module Pact
49
49
  method_option :ignore_failures, type: :boolean, default: false, desc: "If specified, process will always exit with exit code 0", hide: true
50
50
  method_option :pact_urls, aliases: "-u", hide: true, :required => false
51
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
52
+ method_option :log_dir, desc: "The directory for the pact.log file"
53
+ method_option :log_level, desc: "The log level", default: "debug"
52
54
 
53
55
  def verify(*pact_urls)
54
56
  validate_verify
@@ -84,6 +86,7 @@ module Pact
84
86
  validate_consumer_version_selectors
85
87
  validate_wip_since_date
86
88
  validate_credentials
89
+ validate_log_level
87
90
  end
88
91
 
89
92
  def validate_credentials
@@ -119,6 +122,15 @@ module Pact
119
122
  end
120
123
  end
121
124
 
125
+ def validate_log_level
126
+ if options.log_level
127
+ valid_log_levels = %w{debug info warn error fatal}
128
+ if !valid_log_levels.include?(options.log_level.downcase)
129
+ raise InvalidArgumentsError, "Invalid log level '#{options.log_level}'. Must be one of: #{valid_log_levels.join(", ")}."
130
+ end
131
+ end
132
+ end
133
+
122
134
  def exit_with_non_zero_status
123
135
  exit 1
124
136
  end
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module ProviderVerifier
3
- VERSION = "1.30.1"
3
+ VERSION = "1.31.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.30.1
4
+ version: 1.31.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-04-22 00:00:00.000000000 Z
12
+ date: 2020-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec