Closed iangmaia closed 1 month ago
Interesting. CI reports failures in tests that are stubbing
point_to_same_commit?
(a good case for avoiding stubs, however that's easier said than done in this repo...).Example:
FastlaneCore::Helper::GitHelper received :point_to_same_commit? with unexpected arguments | expected: ("origin/release/30.6", "origin/release/30.7") | got: ("trunk", "release/30.7") | Please stub a default value first if message might be received with other args as well.
True, I should've updated stub_expected_pull_requests
with:
- allow(Fastlane::Helper::GitHelper).to receive(:point_to_same_commit?).with("origin/#{target_branch}", "origin/#{source_branch}").and_return(point_to_same_commit)
+ allow(Fastlane::Helper::GitHelper).to receive(:point_to_same_commit?).with(target_branch, source_branch).and_return(point_to_same_commit)
It should be fixed now.
What does it do?
Starting from the comment https://github.com/wordpress-mobile/release-toolkit/pull/587#discussion_r1741270988, I realized we already have checks and logic in place to make sure the head and base branches start with
release/
and that it would make more sense to have any logic related to thepoint_to_same_commit?
check locally vs. on remote in the method itself, so this PR updatespoint_to_same_commit?
for that.Checklist before requesting a review
bundle exec rubocop
to test for code style violations and recommendationsspecs/*_spec.rb
) if applicablebundle exec rspec
to run the whole test suite and ensure all your tests passCHANGELOG.md
file to describe your changes under the appropriate existing###
subsection of the existing## Trunk
section.MIGRATION.md
file to describe how the changes will affect the migration from the previous major version and what the clients will need to change and consider.