Post review follow-up for preload_latest_diff_commit tests
What does this MR do and why?
This MR addresses post-review follow-up items from !203465 (comment 2759674617)
Follow-up items addressed:
-
Remove safe navigation operator (!203465 (comment 2759674617)):
- Removed
&.operator fromcommit.merge_request_commits_metadata&.commit_authorandcommit.merge_request_commits_metadata&.committer - Since we're creating metadata during setup for
with_metadatatests, the safe navigation is unnecessary - This gives us confidence that the whole method chain is called without exceeding query limits
- Removed
-
Split query limit specs for better isolation (!203465 (comment 2759674591)):
- Separated the query limit expectations for
with_metadataandwithout_metadatacases -
with_metadatacase expects max 7 queries -
without_metadatacase expects max 4 queries - This provides better clarity and isolation between the two scenarios
- Separated the query limit expectations for
-
Improve test expectations (!203465 (comment 2759674564) and !203465 (comment 2759674572)):
- Changed from
expect { ... }.not_to raise_errortoexpect(...).to eq([expected_result]) - Testing the end result automatically validates that no error was raised while being more explicit about expectations
- Changed from
References
- Original MR: !203465 (merged)
- Follow-up discussion: !203465 (comment 2759674617)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Gary Holtz