Skip to content

test(just): add bats coverage for update.just and toggle-updates recipes - #626

Merged
castrojo merged 1 commit into
mainfrom
feat/test-update-just
Jun 11, 2026
Merged

test(just): add bats coverage for update.just and toggle-updates recipes#626
castrojo merged 1 commit into
mainfrom
feat/test-update-just

Conversation

@castrojo

Copy link
Copy Markdown
Contributor

Summary

Adds tests/test_update_just.bats with full coverage of the update and toggle-updates recipes.

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

  • Prefers uupd.service when uupd.timer exists
  • Falls back to rpm-ostreed-automatic.service when uupd.timer is absent
  • Exits early when the selected update service is already active
  • Uses rpm-ostree upgrade when LockLayering=false is configured
  • Uses bootc upgrade when LockLayering=false is not set
  • Updates system and user flatpaks only when matching remotes exist
  • Skips flatpak updates when no remotes exist
  • Runs brew upgrade only when the user owns the brew binary
  • Skips brew upgrade when the brew binary is absent

toggle-updates recipe

  • Enables uupd.timer when selected and available
  • Disables rpm-ostreed-automatic.timer when uupd.timer is absent
  • Exits cleanly on Cancel without enabling or disabling timers

CI changes

  • Adds bubblewrap to the apt-get install step (required by bwrap sandbox used in tests)
  • Adds Run bats (update.just) step

Notes

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

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@castrojo, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c07d5979-7e44-4dc5-813a-f70b51e39f84

📥 Commits

Reviewing files that changed from the base of the PR and between a717784 and 907f8fc.

📒 Files selected for processing (3)
  • .github/workflows/unit-tests.yml
  • docs/skills/qa.md
  • tests/test_update_just.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/test-update-just

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Closes #597

Assisted-by: Claude Sonnet 4.6 via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@castrojo
castrojo force-pushed the feat/test-update-just branch from 9fd2d98 to 907f8fc Compare June 11, 2026 06:41
@castrojo
castrojo requested review from a team and repires as code owners June 11, 2026 06:41

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@castrojo
castrojo merged commit 672f3ca into main Jun 11, 2026
8 checks passed
@castrojo
castrojo deleted the feat/test-update-just branch June 11, 2026 11:31
@castrojo castrojo added 4-review A pull request is awaiting review. and removed area/just labels Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4-review A pull request is awaiting review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] Unit tests needed for update.just (primary user update mechanism)

2 participants