Skip to content

Commit

Permalink
chore: update undeployment error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Oct 13, 2021
1 parent e38013e commit 43c79d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/pact_broker/client/deployments/record_undeployment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def application_instance_does_not_match_message
potential_application_instances = currently_deployed_version_entities_for_pacticipant.collect{|e| e.applicationInstance || e.target }

if application_instance
omit_text = potential_application_instances.include?(nil) ? "omit the application instance to undeploy from the anonymous instance" : nil
omit_text = potential_application_instances.include?(nil) ? "omit the application instance" : nil
specify_text = potential_application_instances.compact.any? ? "specify one of the following application instances to record the undeployment from: #{potential_application_instances.compact.join(", ")}" : nil
"#{pacticipant_name} is not currently deployed to application instance '#{application_instance}' in #{environment_name} environment. Please #{[omit_text, specify_text].compact.join(" or ")}."
else
Expand Down
6 changes: 3 additions & 3 deletions script/record-deployments-and-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ bundle exec bin/pact-broker can-i-deploy --pacticipant Foo --version 2 --to-envi

bundle exec bin/pact-broker record-deployment --pacticipant Foo --version 2 --environment test
bundle exec bin/pact-broker record-deployment --pacticipant Foo --version 2 --environment test --target customer-1
bundle exec bin/pact-broker record-deployment --pacticipant Foo --version 2 --environment test --target customer-1
bundle exec bin/pact-broker record-deployment --pacticipant Foo --version 2 --environment test --application-instance customer-1

bundle exec bin/pact-broker record-undeployment --pacticipant Foo --environment test --target customer-2
bundle exec bin/pact-broker record-undeployment --pacticipant Foo --environment test --application-instance customer-2
bundle exec bin/pact-broker record-undeployment --pacticipant Foo --environment test
bundle exec bin/pact-broker record-undeployment --pacticipant Foo --environment test
bundle exec bin/pact-broker record-undeployment --pacticipant Foo --environment test --target customer-1
bundle exec bin/pact-broker record-undeployment --pacticipant Foo --environment test --application-instance customer-1

bundle exec bin/pact-broker record-release --pacticipant Foo --version 2 --environment test
bundle exec bin/pact-broker record-support-ended --pacticipant Foo --version 2 --environment test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ module Deployments

context "when a target is provided and there is no deployed version with a matching target" do
let(:application_instance) { "wrong" }
let(:expected_message) { "Foo is not currently deployed to application instance 'wrong' in test environment. Please omit the application instance to undeploy from the anonymous instance or specify one of the following application instances to record the undeployment from: customer-1." }
let(:expected_message) { "Foo is not currently deployed to application instance 'wrong' in test environment. Please omit the application instance or specify one of the following application instances to record the undeployment from: customer-1." }

its(:success) { is_expected.to be false }
its(:message) { is_expected.to include expected_message }
Expand Down

0 comments on commit 43c79d8

Please sign in to comment.