Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into ruby_3_2_upgraded_deps
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed May 17, 2023
2 parents f4ad8c1 + cff716d commit 4dfa758
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 66 deletions.
4 changes: 2 additions & 2 deletions example/animal-service/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ group :development, :test do
end

gem 'rake'
gem 'rack', '~> 2.2', '>= 2.2.3.1'
gem 'rack', '~> 2.2', '>= 2.2.6.4'
gem 'sqlite3'
gem 'sequel'
gem 'sinatra', '>= 2.2.3'
gem 'sinatra'
64 changes: 33 additions & 31 deletions example/animal-service/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
pact (1.62.0)
pact (1.63.0)
pact-mock_service (~> 3.0, >= 3.3.1)
pact-support (~> 1.16, >= 1.16.9)
rack-test (>= 0.6.3, < 3.0.0)
Expand All @@ -20,11 +20,12 @@ GEM
parslet
filelock (1.1.1)
find_a_port (1.0.1)
json (2.6.2)
json (2.6.3)
method_source (1.0.0)
mustermann (2.0.2)
mini_portile2 (2.8.2)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
pact-mock_service (3.10.0)
pact-mock_service (3.11.0)
filelock (~> 1.1)
find_a_port (~> 1.0.1)
json
Expand All @@ -34,63 +35,64 @@ GEM
term-ansicolor (~> 1.0)
thor (>= 0.19, < 2.0)
webrick (~> 1.3)
pact-support (1.18.1)
pact-support (1.19.0)
awesome_print (~> 1.9)
diff-lcs (~> 1.4)
expgen (~> 0.1)
rainbow (~> 3.1.1)
parslet (2.0.0)
pry (0.14.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
rack (2.2.4)
rack-protection (2.2.2)
rack (2.2.7)
rack-protection (3.0.6)
rack
rack-test (2.0.2)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
rake (13.0.6)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
ruby2_keywords (0.0.5)
sequel (5.59.0)
sinatra (2.2.2)
mustermann (~> 2.0)
rack (~> 2.2)
rack-protection (= 2.2.2)
sequel (5.68.0)
sinatra (3.0.6)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.0.6)
tilt (~> 2.0)
sqlite3 (1.4.4)
sqlite3 (1.6.2)
mini_portile2 (~> 2.8.0)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (1.2.1)
tilt (2.0.11)
tins (1.31.1)
tilt (2.1.0)
tins (1.32.1)
sync
webrick (1.7.0)
webrick (1.8.1)

PLATFORMS
ruby

DEPENDENCIES
pact!
pry
rack (~> 2.2, >= 2.2.3.1)
rack (~> 2.2, >= 2.2.6.4)
rake
rspec
sequel
sinatra (>= 2.2.0)
sinatra
sqlite3

BUNDLED WITH
Expand Down
5 changes: 3 additions & 2 deletions example/zoo-app/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ group :development, :test do
end

gem 'rake'
gem 'rack', '~>2.2'
gem 'httparty'

gem 'rack', '~> 2.2', '>= 2.2.6.4'
gem 'httparty', '>= 0.21.0'
52 changes: 25 additions & 27 deletions example/zoo-app/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
pact (1.62.0)
pact (1.63.0)
pact-mock_service (~> 3.0, >= 3.3.1)
pact-support (~> 1.16, >= 1.16.9)
rack-test (>= 0.6.3, < 3.0.0)
Expand All @@ -21,16 +21,14 @@ GEM
parslet
filelock (1.1.1)
find_a_port (1.0.1)
httparty (0.20.0)
mime-types (~> 3.0)
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
json (2.6.2)
json (2.6.3)
method_source (1.0.0)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
mini_mime (1.1.2)
multi_xml (0.6.0)
pact-mock_service (3.10.0)
pact-mock_service (3.11.0)
filelock (~> 1.1)
find_a_port (~> 1.0.1)
json
Expand All @@ -40,48 +38,48 @@ GEM
term-ansicolor (~> 1.0)
thor (>= 0.19, < 2.0)
webrick (~> 1.3)
pact-support (1.18.1)
pact-support (1.19.0)
awesome_print (~> 1.9)
diff-lcs (~> 1.4)
expgen (~> 0.1)
rainbow (~> 3.1.1)
pact_broker-client (1.51.1)
pact_broker-client (1.66.1)
dig_rb (~> 1.0)
httparty (~> 0.18)
httparty (>= 0.21.0, < 1.0.0)
rake (~> 13.0)
table_print (~> 1.5)
term-ansicolor (~> 1.7)
thor (>= 0.20, < 2.0)
parslet (2.0.0)
pry (0.14.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
rack (2.2.4)
rack-test (2.0.2)
rack (2.2.7)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
rake (13.0.6)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
sync (0.5.0)
table_print (1.5.7)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (1.2.1)
tins (1.31.1)
tins (1.32.1)
sync
webrick (1.7.0)
webrick (1.8.1)

PLATFORMS
ruby
Expand Down
10 changes: 6 additions & 4 deletions tasks/foo-bar.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ require 'pact/tasks/verification_task'
require 'faraday'
# Use for end to end manual debugging of issues.

BROKER_BASE_URL = 'http://localhost:9292'
#BROKER_BASE_URL = 'https://test.pact.dius.com.au'
BROKER_BASE_URL = ENV.fetch('PACT_BROKER_BASE_URL', 'http://localhost:9292')
BROKER_USERNAME = ENV['PACT_BROKER_USERNAME']
BROKER_PASSWORD = ENV['PACT_BROKER_PASSWORD']
BROKER_TOKEN = ENV['PACT_BROKER_TOKEN']

RSpec::Core::RakeTask.new('pact:foobar:create') do | task |
task.pattern = "spec/features/foo_bar_spec.rb"
Expand All @@ -19,11 +19,13 @@ task 'pact:foobar:publish' do
put_request['Content-Type'] = "application/json"
put_request.body = File.read("spec/pacts/foo-bar.json")
put_request.basic_auth(BROKER_USERNAME, BROKER_PASSWORD) if BROKER_USERNAME
put_request['Authorization'] = "Bearer #{BROKER_TOKEN}" if BROKER_TOKEN
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: BROKER_BASE_URL.start_with?('https')) do |http|
http.request put_request
end
puts response.code unless response.code == '200'

# TODO put auth in these requests
tag_response = Faraday.put("#{BROKER_BASE_URL}/pacticipants/Foo/versions/1.0.0/tags/dev", nil, { 'Content-Type' => 'application/json' })
puts tag_response.status unless tag_response.status == 200
tag_response = Faraday.put("#{BROKER_BASE_URL}/pacticipants/Foo/versions/1.0.0/tags/prod", nil, { 'Content-Type' => 'application/json' })
Expand All @@ -41,11 +43,11 @@ Pact::VerificationTask.new('foobar:wip') do | pact |
end

Pact::VerificationTask.new(:foobar_using_broker) do | pact |
pact.uri nil, :pact_helper => './spec/support/bar_pact_helper.rb', username: BROKER_USERNAME, password: BROKER_PASSWORD
pact.uri nil, :pact_helper => './spec/support/bar_pact_helper.rb', username: BROKER_USERNAME, password: BROKER_PASSWORD, token: BROKER_TOKEN
end

Pact::VerificationTask.new('foobar_using_broker:fail') do | pact |
pact.uri "#{BROKER_BASE_URL}/pacts/provider/Bar/consumer/Foo/version/1.0.0", :pact_helper => './spec/support/bar_fail_pact_helper.rb', username: BROKER_USERNAME, password: BROKER_PASSWORD
pact.uri "#{BROKER_BASE_URL}/pacts/provider/Bar/consumer/Foo/version/1.0.0", :pact_helper => './spec/support/bar_fail_pact_helper.rb', username: BROKER_USERNAME, password: BROKER_PASSWORD, token: BROKER_TOKEN
end

task 'pact:verify:foobar' => ['pact:foobar:create']
Expand Down

0 comments on commit 4dfa758

Please sign in to comment.