pact-provider-verifier 0.0.1 → 0.0.3
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 +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/pact/provider_verifier/app.rb +30 -10
- data/lib/pact/provider_verifier/cli.rb +1 -0
- data/lib/pact/provider_verifier/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71e4ffe33c1a74b97cfb4834301a4dd2dc67f63a
|
4
|
+
data.tar.gz: 0204eee0b36220fc0ed232ba2accce7921920c8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d8c09f00d22a74057606b93c8173694c00e666d615c9aab6df479b6ed625a81a18d85ceb25531c2ab970eeba53206612d6b5075549a5cb8ec399b20fc6c6251
|
7
|
+
data.tar.gz: 6ca851afd17f32b0caa3e907f517ff1097e7b8f0b444dcd67f53b75a9ec2bdb677709ab76570184252364522e7f5160b462b9a4ac08b92eb1b2ae0c022ae02b0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require 'pact/provider/proxy/tasks'
|
2
2
|
require 'pact/provider/proxy'
|
3
|
+
require 'pact/provider/rspec'
|
4
|
+
require 'rack/reverse_proxy'
|
5
|
+
require 'pact/cli/run_pact_verification'
|
3
6
|
require 'net/https'
|
4
7
|
require 'faraday_middleware'
|
5
8
|
require 'json'
|
@@ -13,8 +16,6 @@ module Pact
|
|
13
16
|
|
14
17
|
class App
|
15
18
|
def initialize options = {}
|
16
|
-
require 'pp'
|
17
|
-
pp options
|
18
19
|
@options = options
|
19
20
|
end
|
20
21
|
|
@@ -36,17 +37,36 @@ module Pact
|
|
36
37
|
proxy_pact_helper = File.expand_path(File.join(File.dirname(__FILE__), "pact_helper.rb"))
|
37
38
|
ENV['provider_states_url'] = @options.provider_states_url
|
38
39
|
ENV['provider_states_setup_url'] = @options.provider_states_setup_url
|
40
|
+
provider_base_url = @options.provider_base_url
|
39
41
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
task.provider_base_url @options.provider_base_url
|
42
|
+
Pact.service_provider "Running Provider Application" do
|
43
|
+
app do
|
44
|
+
Rack::ReverseProxy.new do
|
45
|
+
reverse_proxy '/', provider_base_url
|
45
46
|
end
|
46
|
-
|
47
|
-
Rake::Task[task_name].invoke
|
48
|
-
Rake::Task[task_name].reenable
|
47
|
+
end
|
49
48
|
end
|
49
|
+
|
50
|
+
require ENV['PACT_PROJECT_PACT_HELPER'] if ENV.fetch('PACT_PROJECT_PACT_HELPER','') != ''
|
51
|
+
|
52
|
+
exit_statuses = pacts.collect do |pact_url|
|
53
|
+
ENV['pact_consumer'] = get_pact_consumer_name(pact_url)
|
54
|
+
|
55
|
+
begin
|
56
|
+
options = {
|
57
|
+
:pact_helper => proxy_pact_helper,
|
58
|
+
:pact_uri => pact_url,
|
59
|
+
:backtrace => false
|
60
|
+
}
|
61
|
+
Cli::RunPactVerification.call(options)
|
62
|
+
rescue SystemExit => e
|
63
|
+
puts ""
|
64
|
+
e.status
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Return non-zero exit code if failures - increment for each Pact
|
69
|
+
exit_statuses.count{ | status | status != 0 }
|
50
70
|
end
|
51
71
|
end
|
52
72
|
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: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Fellows
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.
|
162
|
+
rubygems_version: 2.4.3
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Provides a Pact verification service for use with Pact
|