Skip to content

Commit

Permalink
chore: script/data/verify-pact-for-multiple-selectors.rb [ci-skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Sep 15, 2021
1 parent 3a7490d commit 2499a45
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions script/data/verify-pact-for-multiple-selectors.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/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_pacticipant("some-consumer")
.delete_pacticipant("some-provider")
.create_pacticipant("some-consumer")
.create_pacticipant("some-provider")
.publish_pact(consumer: "some-consumer", consumer_version: "1", provider: "some-provider", content_id: "111", branch: "main")
.publish_pact(consumer: "some-consumer", consumer_version: "2", provider: "some-provider", content_id: "111", branch: "feat/x")
.get_pacts_for_verification(
provider_version_tag: "main",
consumer_version_selectors: [{ branch: "main" }, { branch: "feat/x" }]
)
.verify_pact(
index: 0,
provider_version_tag: "main",
provider_version: "1",
success: true
)

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

0 comments on commit 2499a45

Please sign in to comment.