Skip to content

Commit

Permalink
test: update matrix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Aug 11, 2021
1 parent 0e9e923 commit 661f91c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
6 changes: 1 addition & 5 deletions spec/fixtures/approvals/matrix_integration_spec.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,18 @@ PactBroker::Matrix::Service find find returns a QueryResultsWithDeploymentStatus
PactBroker::Matrix::Service find when deploying a consumer that has not been verified by any providers returns 2 integrations:
deployable:
reasons:
- PactBroker::Matrix::NoEnvironmentSpecified
- PactBroker::Matrix::PactNotEverVerifiedByProvider
- PactBroker::Matrix::PactNotEverVerifiedByProvider
? PactBroker::Matrix::Service find when deploying a consumer that has not been verified
by any providers but cannot resolve selectors for the providers
by any providers it creates selectors for the providers
: deployable:
reasons:
- PactBroker::Matrix::NoEnvironmentSpecified
- PactBroker::Matrix::PactNotEverVerifiedByProvider
- PactBroker::Matrix::PactNotEverVerifiedByProvider
? PactBroker::Matrix::Service find when deploying a consumer that has not been verified
by any providers does not allow the consumer to be deployed
: deployable:
reasons:
- PactBroker::Matrix::NoEnvironmentSpecified
- PactBroker::Matrix::PactNotEverVerifiedByProvider
- PactBroker::Matrix::PactNotEverVerifiedByProvider
? 'PactBroker::Matrix::Service find when deploying a consumer that has two providers
Expand Down Expand Up @@ -59,7 +56,6 @@ PactBroker::Matrix::Service find when deploying a consumer that has not been ver
to be deployed
: deployable: true
reasons:
- PactBroker::Matrix::NoEnvironmentSpecified
- PactBroker::Matrix::Successful
PactBroker::Matrix::Service find when the specified version does not exist does not allow the app to be deployed:
deployable: false
Expand Down
14 changes: 10 additions & 4 deletions spec/lib/pact_broker/matrix/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ module Matrix
[ UnresolvedSelector.new(pacticipant_name: "Foo", pacticipant_version_number: "1") ]
end

let(:options) do
{ latest: true, tag: "prod", latestby: "cvp" }
end

it "returns 2 integrations" do
expect(subject.integrations.size).to eq 2
end

it "but cannot resolve selectors for the providers" do
expect(subject.resolved_selectors.size).to eq 1
it "it creates selectors for the providers" do
expect(subject.resolved_selectors.size).to eq 3
end

it "does not allow the consumer to be deployed" do
Expand All @@ -111,7 +115,7 @@ module Matrix
[ UnresolvedSelector.new(pacticipant_name: "Foo", pacticipant_version_number: "3.0.0") ]
end

let(:options) { {latest: true, tag: "prod", latestby: "cvp"} }
let(:options) { { latest: true, tag: "prod", latestby: "cvp" } }

it "returns 2 integrations" do
expect(subject.integrations.size).to eq 2
Expand All @@ -133,7 +137,7 @@ module Matrix
describe "when deploying an old version of a consumer that has added a new provider since that version" do
before do
td.create_pact_with_hierarchy("Foo", "1", "Bar")
.create_verification(provider_version: "2")
.create_verification(provider_version: "2", tag_names: ["prod"])
.create_consumer_version("2")
.create_pact
.create_verification(provider_version: "3")
Expand All @@ -146,6 +150,8 @@ module Matrix
[ UnresolvedSelector.new(pacticipant_name: "Foo", pacticipant_version_number: "1") ]
end

let(:options) { { latest: true, tag: "prod", latestby: "cvp" } }

it "allows the old version of the consumer to be deployed" do
expect(subject.deployment_status_summary).to be_deployable
end
Expand Down

0 comments on commit 661f91c

Please sign in to comment.