Skip to content

test: fix host-dependent rpmdev-bumpspec mocks - #399

Merged
Nan Liu (liunan-ms) merged 2 commits into
microsoft:mainfrom
ddstreet:fix/rpmdev-bumpspec-test-command-matching
Oct 27, 2026
Merged

Nan Liu (liunan-ms) merged 2 commits into
microsoft:mainfrom
ddstreet:fix/rpmdev-bumpspec-test-command-matching

Conversation

@ddstreet

Copy link
Copy Markdown
Contributor

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.

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
Copilot AI balanced review requested due to automatic review settings October 22, 2026 00:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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-bumpspec using cmd.Args[0] rather than the potentially resolved absolute cmd.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

Copilot AI balanced review requested due to automatic review settings October 27, 2026 17:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrow test-only changes preserve existing assertions while correctly matching the requested executable, with no identified blocking issues.

No open issues 🎉

Review effort: Balanced

@liunan-ms
Nan Liu (liunan-ms) merged commit d0a9403 into microsoft:main Oct 27, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants