forked from pact-foundation/pact_broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreproduce-issue.rb
executable file
·31 lines (28 loc) · 1.11 KB
/
reproduce-issue.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env ruby
begin
$LOAD_PATH << "#{Dir.pwd}/lib"
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: "foo-consumer", provider: "bar-provider")
.publish_pact(consumer: "foo-consumer", consumer_version: "1", provider: "bar-provider", 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: true
)
.can_i_deploy(pacticipant: "bar-provider", version: "1", to: "prod")
.deploy_to_prod(pacticipant: "bar-provider", version: "1")
.can_i_deploy(pacticipant: "foo-consumer", version: "1", to: "prod")
.deploy_to_prod(pacticipant: "foo-consumer", version: "1")
rescue StandardError => e
puts "#{e.class} #{e.message}"
puts e.backtrace
exit 1
end