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 +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +24 -26
- data/lib/pact/provider_verifier/app.rb +2 -0
- data/lib/pact/provider_verifier/cli/verify.rb +12 -0
- data/lib/pact/provider_verifier/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44c17f0743c806ca23c26957d6011ed92fa7374cf25c2077e2d8fac967695d97
|
4
|
+
data.tar.gz: edd33bd8d49c5a74fb5ddac57f71cd9639963d207a24efe52638d0242a567c2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e651daba957e5270412987777d03b253b54e662ee2205085f62a090eaaa405ab8fa6ecfc50db986365cbf35146c5f6568c4abb7d923f4146d9614e172eece82
|
7
|
+
data.tar.gz: d325e9aca5995fe88bba89b7fc6cd10e4a858a3c5cd3d540ae5e9b03b78454ad80d5ea6b46142cfbaa797c5ce7a59e77863e64773719b4a173ffad2bc2ab6031
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -41,55 +41,53 @@ Usage:
|
|
41
41
|
|
42
42
|
Options:
|
43
43
|
-h, --provider-base-url=PROVIDER_BASE_URL
|
44
|
-
|
44
|
+
# Provider host URL
|
45
45
|
-c, [--provider-states-setup-url=PROVIDER_STATES_SETUP_URL]
|
46
|
-
|
46
|
+
# Base URL to setup the provider states at
|
47
47
|
[--pact-broker-base-url=PACT_BROKER_BASE_URL]
|
48
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
63
|
+
# Provider application version, required when publishing verification results
|
64
64
|
-r, [--publish-verification-results], [--no-publish-verification-results]
|
65
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
71
|
+
# Verbose output
|
74
72
|
-f, [--format=FORMATTER]
|
75
|
-
|
73
|
+
# RSpec formatter. Defaults to custom Pact formatter. Other options are json and RspecJunitFormatter (which outputs xml).
|
76
74
|
-o, [--out=FILE]
|
77
|
-
|
75
|
+
# Write output to a file instead of $stdout.
|
78
76
|
[--wait=SECONDS]
|
79
|
-
|
77
|
+
# The number of seconds to poll for the provider to become available before running the verification
|
80
78
|
|
81
|
-
|
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
|
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
|
91
|
-
version tag) and 'latest' (true|false). For example '{"tag": "master",
|
92
|
-
true}'. For a detailed explanation of selectors, see
|
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
|
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.
|
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-
|
12
|
+
date: 2020-06-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|