pact-provider-verifier 1.10.0 → 1.11.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: 710449d3f7377b9c94bf10e484ad2540b94573e91809fe9778dc708c5bdfd3bf
4
- data.tar.gz: f974cf92df85aad57883557f468b5661fbd0790d5a9e2df3ba4d6472ac4c5761
3
+ metadata.gz: 92bf234cf9e7a504348192720df8de381b66fadfc53c871c6ec24f009b084b03
4
+ data.tar.gz: c9fb9ee424d70abedb986251beb4adb1caddd0acef2edeef1a662b2fc4013a3a
5
5
  SHA512:
6
- metadata.gz: 865383b20a0d8f6d173f6578365c533aeebdbaa238447d67d1861e3f9115580c223c793af6e246b2a071fd972699c6a6d7f8ff576a6892cc7b3249910a34cc26
7
- data.tar.gz: ce53d41c5e87c91f50804e9bf56e22d07c955b67f87de22a3b9da0aa7bbe9c80d656ca98ad90409133faaaf2bb2ebeb92efb6800ca26a311b8aa13f275978c23
6
+ metadata.gz: 3ef9c0d39e8bc82e710df3b9fc57f68d37cca7f3a95c61c38ee760461dbf41d3fab65e744984f3f5a9b2186e88d4cdeed8f606909dccde82ba850347d73c6aeb
7
+ data.tar.gz: fc1265d71177994ca48f88c270ab9a5fc7f671f7a1b6be4a667c23c131b545c682258e5681f63c3c596760f45be935dcfc5246700386e31ffb26d246d881a7ff
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ <a name="v1.11.0-1"></a>
2
+ ### v1.11.0-1 (2017-12-07)
3
+
4
+
5
+ #### Features
6
+
7
+ * maintain path portion of specified provider base URL ([b765b00](/../../commit/b765b00))
8
+
9
+
1
10
  <a name="v1.10.0-1"></a>
2
11
  ### v1.10.0-1 (2017-11-11)
3
12
 
data/README.md CHANGED
@@ -11,6 +11,7 @@ binary-like CLI tool.
11
11
  * Verify Pacts against Pacts published to an http endpoint, such as a [Pact Broker](https://github.com/pact-foundation/pact_broker)
12
12
  * Verify local `*.json` Pacts on the file system
13
13
  * Works with Pact [provider states](https://docs.pact.io/documentation/provider_states.html) should you need them
14
+ * Publishes the verification results back to the pact broker if the pact was retrieved from a broker.
14
15
 
15
16
  ## Installation
16
17
 
@@ -20,7 +21,7 @@ Take a look at https://github.com/DiUS/pact-provider-verifier-docker.
20
21
 
21
22
  ### Native Installation
22
23
 
23
- Download the appropriate [release](https://github.com/pact-foundation/pact-provider-verifier/releases)
24
+ Download the appropriate [release](https://github.com/pact-foundation/pact-ruby-standalone/releases)
24
25
  for your OS and put somewhere on your `PATH`.
25
26
 
26
27
  ### With Ruby on Mac OSX and Linux
@@ -32,6 +33,27 @@ pact-provider-verifier <args>
32
33
 
33
34
  Run `pact-provider-verifier help` for command line options.
34
35
 
36
+ ## Usage
37
+
38
+ ```
39
+ Usage:
40
+ pact-provider-verifier PACT_URL ... -h, --provider-base-url=PROVIDER_BASE_URL
41
+
42
+ Options:
43
+ -h, --provider-base-url=PROVIDER_BASE_URL # Provider host URL
44
+ -c, [--provider-states-setup-url=PROVIDER_STATES_SETUP_URL] # Base URL to setup the provider states at
45
+ -a, [--provider-app-version=PROVIDER_APP_VERSION] # Provider application version, required when publishing verification results
46
+ -r, [--publish-verification-results=PUBLISH_VERIFICATION_RESULTS] # Publish verification results to the broker
47
+ -n, [--broker-username=BROKER_USERNAME] # Pact Broker basic auth username
48
+ -p, [--broker-password=BROKER_PASSWORD] # Pact Broker basic auth password
49
+ [--custom-provider-header=CUSTOM_PROVIDER_HEADER] # Header to add to provider state set up and pact verification requests. eg 'Authorization: Basic cGFjdDpwYWN0'. May be specified multiple times.
50
+ -v, [--verbose=VERBOSE] # Verbose output
51
+ -f, [--format=FORMATTER] # RSpec formatter. Defaults to custom Pact formatter. json and RspecJunitFormatter may also be used.
52
+ -u, [--pact-urls=PACT_URLS] # DEPRECATED. Please provide as space separated arguments.
53
+
54
+ Verify pact(s) against a provider. Supports local and networked (http-based) files.
55
+ ```
56
+
35
57
  ## Examples
36
58
 
37
59
  See the [example](examples) for a demonstration with a [Sinatra](http://www.sinatrarb.com/) API:
@@ -48,10 +70,15 @@ bundle install
48
70
 
49
71
  1. Create an API and a corresponding Docker image for it
50
72
  1. Publish Pacts to the Pact broker (or create local ones)
51
- 1. Run the CLI tool for your OS, passing the appropriate flags:
52
- * `--pact_urls` - a comma delimited list of local Pact file urls or Pact Broker URLs.
53
- * `--provider_base_url` - the base url of the pact provider (i.e. your API)
54
- 1.
73
+ 1. Run the CLI tool for your OS, passing the appropriate arguments:
74
+ * a space delimited list of local Pact file URLs or Pact Broker URLs.
75
+ * `--provider-base-url` - the base url of the provider (i.e. your API)
76
+
77
+ eg.
78
+
79
+ ```
80
+ pact-provider-verifier foo-bar.json --provider-base-url http://localhost:9292
81
+ ```
55
82
 
56
83
  ### Setting a custom Authentication header
57
84
 
@@ -61,17 +88,26 @@ Modification of the request headers is sometimes necessary, but be aware that an
61
88
 
62
89
  ### API with Provider States
63
90
 
64
- Execute pact provider verification against a provider which implements the following:
91
+ Read the [Provider States section on docs.pact.io](https://docs.pact.io/documentation/provider_states.html) for an introduction to provider states.
92
+
93
+ To allow the correct data to be set up before each interaction is replayed, you will need to create a dev/test only HTTP endpoint that accepts a JSON document that looks like:
94
+
95
+ ```json
96
+ {
97
+ "consumer": "CONSUMER_NAME",
98
+ "state": "PROVIDER_STATE"
99
+ }
100
+ ```
101
+
102
+ The endpoint should set up the given provider state for the given consumer synchronously, and return an error if the provider state is not recognised. Namespacing your provider states within each consumer will avoid clashes if more than one consumer defines the same provider state with different data.
65
103
 
66
- * an http POST endpoint (`--provider-states-setup-url`) which sets the active pact consumer and provider state accepting two parameters: `consumer` and `state` and returns an HTTP `200` eg.
104
+ The following flag is required when running the CLI:
67
105
 
68
- consumer=web&state=customer%20is%20logged%20in
106
+ * `--provider-states-setup-url` - the full url of the endpoint which sets the active consumer and provider state.
69
107
 
70
- The following flags are required:
108
+ Rather than tearing down the specific test data created after each interaction, you should clear all the existing data at the start of each set up call. This is a more reliable method of ensuring that your test data does not leak from one test to another.
71
109
 
72
- * `--pact-urls` - a comma delimited list of pact file urls
73
- * `--provider-base-url` - the base url of the pact provider
74
- * `--provider-states-setup-url` - the full url of the endpoint which sets the active pact consumer and provider state
110
+ Note that the HTTP endpoint does not have to actually be within your application - it just has to have access to the same data store. So if you cannot add "test only" endpoints during your verification, consider making a separate app which shares credentials to your app's datastore. It is highly recommended that you run your verifications against a locally running provider, rather than a deployed one, as this will make it much easier to stub any downstream calls, debug issues, and it will make your tests run as fast as possible.
75
111
 
76
112
  ### Using the Pact Broker with Basic authentication
77
113
 
@@ -79,7 +79,7 @@ module Pact
79
79
  preserve_host: true,
80
80
  x_forwarded_headers: false
81
81
  )
82
- reverse_proxy '/', provider_base_url
82
+ reverse_proxy /(.*)/, "#{provider_base_url}$1"
83
83
  end
84
84
  end
85
85
 
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module ProviderVerifier
3
- VERSION = "1.10.0"
3
+ VERSION = "1.11.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-provider-verifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Fellows
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-11 00:00:00.000000000 Z
11
+ date: 2017-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -303,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
303
  version: '0'
304
304
  requirements: []
305
305
  rubyforge_project:
306
- rubygems_version: 2.7.2
306
+ rubygems_version: 2.7.3
307
307
  signing_key:
308
308
  specification_version: 4
309
309
  summary: Provides a Pact verification service for use with Pact