Repository navigation
test: fix host-dependent rpmdev-bumpspec mocks - #399
Merged
Nan Liu (liunan-ms) merged 2 commits intoOct 27, 2026
Merged
Nan Liu (liunan-ms) merged 2 commits into
Nan Liu (liunan-ms) merged 2 commits into
Conversation
Match rpmdev-bumpspec commands by their requested executable in cmd.Args[0] instead of cmd.Path, which exec.CommandContext may resolve to an absolute host path. Keep the mocks working whether rpmdev-bumpspec is installed on the host. Apply the same matching to release-bump transaction tests and the dry-run assertion without changing production behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 086236b0-c4cd-4289-ace7-c82d78940883
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped test changes match command construction and remove host-path dependence without identified regressions.
No open issues 🎉
What changed in this PR
This PR removes host-dependent executable matching from RPM release-bump tests without changing production behavior.
Changes:
- Match
rpmdev-bumpspecusingcmd.Args[0]rather than the potentially resolved absolutecmd.Path. - Apply the same matching to release-bump transaction mocks and the dry-run assertion.
| File | Description |
|---|---|
internal/app/azldev/core/sources/release_internal_test.go |
Makes release-bump transaction mocks independent of host executable paths. |
internal/app/azldev/core/sources/bumpspec_internal_test.go |
Updates bumpspec mocks and the dry-run assertion to match the requested executable. |
Review effort: Balanced
Nan Liu (liunan-ms)
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Match rpmdev-bumpspec commands by their requested executable in cmd.Args[0] instead of cmd.Path, which exec.CommandContext may resolve to an absolute host path. Keep the mocks working whether rpmdev-bumpspec is installed on the host.
Apply the same matching to release-bump transaction tests and the dry-run assertion without changing production behavior.