pact-provider-verifier 0.0.1 → 0.0.3

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
  SHA1:
3
- metadata.gz: f7a5fd688d1159700ffd162bbd72100520e2bfc6
4
- data.tar.gz: 4c21909a48dfffe600806b01375eef4f94bb42ad
3
+ metadata.gz: 71e4ffe33c1a74b97cfb4834301a4dd2dc67f63a
4
+ data.tar.gz: 0204eee0b36220fc0ed232ba2accce7921920c8b
5
5
  SHA512:
6
- metadata.gz: a6967ba29737b5b2d2cba5f5033c9d358d43048c8e02cd690f88cc7abf1ef9461313021e95f23918b65cf385bfbd134a97433302fc3e6badd849287fe61e7df8
7
- data.tar.gz: 79214d06a799bd5ad95d98c5fcd19e48ce7000113b45fa907a6e52bd7b24c17f902c4eef83b1f181295da0631ec964ca5d8ecb42732c5dbb2bfc2b521800708b
6
+ metadata.gz: 1d8c09f00d22a74057606b93c8173694c00e666d615c9aab6df479b6ed625a81a18d85ceb25531c2ab970eeba53206612d6b5075549a5cb8ec399b20fc6c6251
7
+ data.tar.gz: 6ca851afd17f32b0caa3e907f517ff1097e7b8f0b444dcd67f53b75a9ec2bdb677709ab76570184252364522e7f5160b462b9a4ac08b92eb1b2ae0c022ae02b0
data/CHANGELOG.md CHANGED
@@ -3,3 +3,5 @@ Do this to generate your change history
3
3
  git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
4
4
 
5
5
  ### 0.0.1 (8 May 2016)
6
+
7
+ * 39e75f3 - Pact provider verifier cross-platform CLI tool (Matt Fellows, Thu May 12 07:30:47 2016 +1000)
@@ -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
- pacts.each do |pact_url|
41
- Pact::ProxyVerificationTask.new :"#{pact_url}" do | task |
42
- ENV['pact_consumer'] = get_pact_consumer_name(pact_url)
43
- task.pact_url pact_url, :pact_helper => proxy_pact_helper
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
- task_name = "pact:verify:#{pact_url}"
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
@@ -13,6 +13,7 @@ module Pact
13
13
 
14
14
  def verify
15
15
  app = Pact::ProviderVerifier::App.new(options)
16
+ app.verify_pacts
16
17
  end
17
18
 
18
19
  default_task :verify
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module ProviderVerifier
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.3"
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: 0.0.1
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 00:00:00.000000000 Z
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.2.0
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