test(just): add bats coverage for update.just and toggle-updates recipes - #626
Conversation
|
Warning Review limit reached
More reviews will be available in 55 minutes and 12 seconds. Learn how PR review limits work. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #597 Assisted-by: Claude Sonnet 4.6 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9fd2d98 to
907f8fc
Compare
hanthor
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Verdict: LGTM 🟢
Solid test coverage for update.just and toggle-updates. The parameter-driven mock design (systemctl via env vars, brew path via python patch) is clean and reusable. Critical branches covered: uupd vs rpm-ostreed fallback, bootc upgrade path, flatpak remotes, toggle enable/disable/cancel.
Summary
Adds
tests/test_update_just.batswith full coverage of theupdateandtoggle-updatesrecipes.Uses the established
_extract_script()awk pattern to extract each recipe's bash body and runs it inside a bubblewrap sandbox with mocked binaries.Test cases
update recipe
uupd.servicewhenuupd.timerexistsrpm-ostreed-automatic.servicewhen uupd.timer is absentrpm-ostree upgradewhen LockLayering=false is configuredbootc upgradewhen LockLayering=false is not settoggle-updates recipe
uupd.timerwhen selected and availablerpm-ostreed-automatic.timerwhen uupd.timer is absentCI changes
bubblewrapto the apt-get install step (required by bwrap sandbox used in tests)Run bats (update.just)stepNotes
unit-tests.yml is also modified by the other test PRs from this sprint. Changes are additive and non-overlapping; minor rebases may be needed when merging multiple PRs.
Closes #597