From dd349491512d99bd917f310a54e42acf3671af7c Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 6 Aug 2021 17:01:32 +1000 Subject: [PATCH] chore: update data scripts [ci-skip] --- ...ntract-published-requiring-verification.rb | 20 ++++---- ...produce-issue-expand-currently-deployed.rb | 47 ------------------- 2 files changed, 10 insertions(+), 57 deletions(-) delete mode 100755 script/reproduce-issue-expand-currently-deployed.rb diff --git a/script/data/contract-published-requiring-verification.rb b/script/data/contract-published-requiring-verification.rb index 2de3cbf6e..f18b81b6b 100755 --- a/script/data/contract-published-requiring-verification.rb +++ b/script/data/contract-published-requiring-verification.rb @@ -6,18 +6,18 @@ base_url = ENV["PACT_BROKER_BASE_URL"] || "http://localhost:9292" td = PactBroker::Test::HttpTestDataBuilder.new(base_url) - td.delete_integration(consumer: "Foo", provider: "Bar") - .delete_integration(consumer: "foo-consumer", provider: "bar-provider") - .create_global_webhook_for_event(uuid: "7a5da39c-8e50-4cc9-ae16-dfa5be043e8c", event_name: "contract_requiring_verification_published") + td.create_global_webhook_for_event(uuid: "7a5da39c-8e50-4cc9-ae16-dfa5be043e8c", event_name: "contract_requiring_verification_published") + .delete_by_pacticipant("NewWebhookTestConsumer") + .delete_by_pacticipant("NewWebhookTestProvider") .create_environment(name: "test") .create_environment(name: "prod", production: true) - .create_pacticipant("Foo", main_branch: "main") - .create_pacticipant("Bar", main_branch: "main") - .create_version(pacticipant: "Bar", version: "1", branch: "main") - .record_deployment(pacticipant: "Bar", version: "1", environment_name: "test") - .record_deployment(pacticipant: "Bar", version: "1", environment_name: "prod") - .create_version(pacticipant: "Bar", version: "2", branch: "main") - .publish_pact(consumer: "Foo", consumer_version: "1", provider: "Bar", content_id: "111") + .create_pacticipant("NewWebhookTestConsumer", main_branch: "main") + .create_pacticipant("NewWebhookTestProvider", main_branch: "main") + .create_version(pacticipant: "NewWebhookTestProvider", version: "1", branch: "main") + .record_deployment(pacticipant: "NewWebhookTestProvider", version: "1", environment_name: "test") + .record_deployment(pacticipant: "NewWebhookTestProvider", version: "1", environment_name: "prod") + .create_version(pacticipant: "NewWebhookTestProvider", version: "2", branch: "main") + .publish_pact(consumer: "NewWebhookTestConsumer", consumer_version: "1", provider: "NewWebhookTestProvider", content_id: "111") rescue StandardError => e puts "#{e.class} #{e.message}" diff --git a/script/reproduce-issue-expand-currently-deployed.rb b/script/reproduce-issue-expand-currently-deployed.rb deleted file mode 100755 index 36f786082..000000000 --- a/script/reproduce-issue-expand-currently-deployed.rb +++ /dev/null @@ -1,47 +0,0 @@ -#!/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", provider: "Bar") - .delete_integration(consumer: "foo-consumer", provider: "bar-provider") - .create_environment(name: "test") - .create_environment(name: "prod", production: true) - .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 - ) - .record_deployment(pacticipant: "bar-provider", version: "1", environment_name: "test") - .record_deployment(pacticipant: "bar-provider", version: "1", environment_name: "prod") - .record_deployment(pacticipant: "foo-consumer", version: "1", environment_name: "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: "2", - success: true - ) - .record_deployment(pacticipant: "bar-provider", version: "2", environment_name: "test") - .create_global_webhook_for_contract_changed(uuid: "7a5da39c-8e50-4cc9-ae16-dfa5be043e8c") - .publish_pact(consumer: "foo-consumer", consumer_version: "2", provider: "bar-provider", content_id: "222", tag: "main") - -rescue StandardError => e - puts "#{e.class} #{e.message}" - puts e.backtrace - exit 1 -end