Skip to content

Commit

Permalink
chore: update issue reproduction
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Dec 14, 2020
1 parent 4523227 commit 5208b4e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 22 deletions.
43 changes: 43 additions & 0 deletions script/reproduce-issue-starting-up.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env ruby

$LOAD_PATH << "#{Dir.pwd}/lib"

begin

require 'pact_broker/test/http_test_data_builder'
base_url = ENV['PACT_BROKER_BASE_URL'] || 'http://localhost:9292'

td = PactBroker::Test::HttpTestDataBuilder.new(base_url, { })
td.delete_integration(consumer: "MyConsumer", provider: "MyProvider")
.can_i_deploy(pacticipant: "MyProvider", version: "1", to: "prod")
.can_i_deploy(pacticipant: "MyConsumer", version: "1", to: "prod")
.publish_pact(consumer: "MyConsumer", consumer_version: "1", provider: "MyProvider", content_id: "111", tag: "feature/a")
.can_i_deploy(pacticipant: "MyProvider", version: "1", to: "prod")
.get_pacts_for_verification(
enable_pending: true,
provider_version_tag: "main",
include_wip_pacts_since: "2020-01-01",
consumer_version_selectors: [{ tag: "main", latest: true }])
.verify_pact(
index: 0,
provider_version_tag: "main",
provider_version: "1",
success: false
)
.get_pacts_for_verification(
enable_pending: true,
provider_version_tag: "main",
include_wip_pacts_since: "2020-01-01",
consumer_version_selectors: [{ tag: "main", latest: true }])
.can_i_deploy(pacticipant: "MyProvider", version: "1", to: "prod")
.can_i_deploy(pacticipant: "MyConsumer", version: "1", to: "prod")
.deploy_to_prod(pacticipant: "MyProvider", version: "1")
.can_i_deploy(pacticipant: "MyConsumer", version: "1", to: "prod")
.deploy_to_prod(pacticipant: "MyConsumer", version: "1")

rescue StandardError => e
puts "#{e.class} #{e.message}"
puts e.backtrace
exit 1
end

24 changes: 2 additions & 22 deletions script/reproduce-issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,11 @@

td = PactBroker::Test::HttpTestDataBuilder.new(base_url, { })
td.delete_integration(consumer: "MyConsumer", provider: "MyProvider")
.can_i_deploy(pacticipant: "MyProvider", version: "1", to: "prod")
.can_i_deploy(pacticipant: "MyConsumer", version: "1", to: "prod")
.publish_pact(consumer: "MyConsumer", consumer_version: "1", provider: "MyProvider", content_id: "111", tag: "feature/a")
.can_i_deploy(pacticipant: "MyProvider", version: "1", to: "prod")
.publish_pact(consumer: "MyConsumer", consumer_version: "1", provider: "MyProvider", content_id: "111", tag: "main")
.get_pacts_for_verification(
enable_pending: true,
provider_version_tag: "main",
include_wip_pacts_since: "2020-01-01",
consumer_version_selectors: [{ tag: "main", latest: true }])
.verify_pact(
index: 0,
provider_version_tag: "main",
provider_version: "1",
success: false
)
.get_pacts_for_verification(
enable_pending: true,
provider_version_tag: "main",
include_wip_pacts_since: "2020-01-01",
consumer_version_selectors: [{ tag: "main", latest: true }])
.can_i_deploy(pacticipant: "MyProvider", version: "1", to: "prod")
.can_i_deploy(pacticipant: "MyConsumer", version: "1", to: "prod")
.deploy_to_prod(pacticipant: "MyProvider", version: "1")
.can_i_deploy(pacticipant: "MyConsumer", version: "1", to: "prod")
.deploy_to_prod(pacticipant: "MyConsumer", version: "1")


rescue StandardError => e
puts "#{e.class} #{e.message}"
Expand Down

0 comments on commit 5208b4e

Please sign in to comment.