Skip to content

Commit 228f3dc

Browse files
committed
Add regression test for grouped PR with one failing metadata cascade
Verifies that when one dependency's metadata cascade raises in a multi-dependency PR, the other dependency's metadata is unaffected and the overall PR message still renders.
1 parent a9cc060 commit 228f3dc

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

common/spec/dependabot/pull_request_creator/message_builder_spec.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,27 @@ def commits_details(base:, head:)
19501950
)
19511951
end
19521952

1953+
context "when one dependency's metadata cascade raises" do
1954+
before do
1955+
stub_request(
1956+
:get,
1957+
"https://api.github.com/repos/gocardless/statesman/contents/CHANGELOG.md?ref=master"
1958+
).to_raise(SocketError, "Connection refused - connect(2) for \"api.github.com\" port 443")
1959+
end
1960+
1961+
it "still renders the PR message with the unaffected dependency's metadata" do
1962+
expect(pr_message).to include(
1963+
"Bumps [business](https://github.com/gocardless/business) " \
1964+
"and [statesman](https://github.com/gocardless/statesman). " \
1965+
"These dependencies needed to be updated together."
1966+
)
1967+
expect(pr_message).to include("Updates `business` from 1.4.0 to 1.5.0")
1968+
expect(pr_message).to include("business's changelog")
1969+
expect(pr_message).to include("Updates `statesman` from 1.6.0 to 1.7.0")
1970+
expect(pr_message).not_to include("statesman's changelog")
1971+
end
1972+
end
1973+
19531974
context "when dealing with a property dependency (e.g., with Maven)" do
19541975
before do
19551976
statesman_repo_url =

0 commit comments

Comments
 (0)