[quality] test(apps.just): BATS coverage for install-opentabletdriver and cncf - #1064
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
[quality] test(apps.just): BATS coverage for install-opentabletdriver and cncf#1064kubestellar-hive[bot] wants to merge 1 commit into
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
… and cncf
Adds tests/test_apps_just.bats — 21 cases covering the two apps.just
recipes that do not touch brew tap:
install-opentabletdriver (gum confirm dispatch, asset selection,
udev rule rename, modprobe blacklist,
tmpdir cleanup, flatpak install/remove,
user service unit, Ctrl-C exit 130)
cncf (brew bundle Brewfile path, non-tty
ujust --choose skip, failure tolerance)
The install-jetbrains-toolbox and install-asus recipes in the same file
are deliberately left uncovered: their brew tap --trust lines are being
changed by other open PRs.
Wires the file into the Justfile test recipe.
Co-authored-by: Copilot <[email protected]>
Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
hanthor
approved these changes
Sep 2, 2026
hanthor
left a comment
Member
There was a problem hiding this comment.
New tests/test_apps_just.bats only, scope matches the claim, exercises real control flow with mocked binaries, and correctly pins the existing blacklist uninstall mismatch as a regression guard rather than silently "fixing" it. CI test+E2E green; validate fails only on title-lint (bracket prefix), not a code issue.
Generated by Claude Code
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.
Claimed ground
File under test:
system_files/shared/usr/share/ublue-os/just/apps.justRecipes claimed:
install-opentabletdriver,cncf— only these two.New file:
tests/test_apps_just.bats(21 cases)Also touched:
Justfile(one added line in thetestrecipe)Disjointness check against open PRs
apps.justis partially occupied ground, so this PR deliberately claims onlythe recipes no open PR touches:
apps.just[scanner] fix: use valid brew tap trust commandsbrew tap --trustlines ininstall-jetbrains-toolbox,install-asusfix(brew): replace invalid brew tap --trust(+tests/test_brew_tap_trust.bats)brew tap --trustlines[quality] test(default.just)default.just/tests/test_default_just.bats[quality] test(shared.just)shared.just/tests/test_shared_just.bats[quality] test(system.just)system.just/tests/test_system_just.bats[architect] setup hook dispatchublue-*-setup,hookrunner.sh[architect] image-name → upstream routingbonedigger-report,changelog.justinstall-jetbrains-toolboxandinstall-asusare not covered by this PR.A test in this file (
apps.just recipes covered here do not call brew tap)pins that scope boundary so a future edit cannot silently pull the brew-tap
recipes into this suite while #978/#941 are still open.
Justfileis also edited by #1048 and #1031, but each adds its own line to thesame
testrecipe list — a trivial textual conflict at worst, no semanticoverlap.
What this adds
apps.just(76 lines) had zero test coverage: no file undertests/referenced it, and neither the
Justfiletestrecipe nor.github/workflows/unit-tests.ymlexecuted anything against it.tests/test_apps_just.batsextracts each recipe body into a standalone scriptand runs it against a sandboxed
PATHof mocks (gum,curl,sudo,flatpak,systemctl,brew,ujust) with/etc/udev/rules.d,/etc/modprobe.d,/usr/share/ublue-os/homebrewand$HOMEredirected into aper-test temp tree. This follows the existing pattern in
tests/test_update_just.bats. No network, no root, no host mutation.install-opentabletdrivergum confirmexit 0 → install branch; exit 1 → uninstall branch; exit 130(Ctrl-C) → neither branch runs and no
flatpakcall is madejqasset filter picks the.tar.gzrelease asset and not the.debor
.rpmdecoys70-opentabletdriver.rules→71-opentabletdriver.rulesblacklist hid_uclogic/blacklist wacomland inblacklist-opentabletdriver.confmktemp -dextraction directory is removedflatpak --system install/flatpak --system removeare issued on thecorrect branches
$HOME/.config/systemd/user/and enabledcncfbrew bundle --file=.../cncf.Brewfileis invoked with the curated Brewfile pathujust --chooseis skipped when stdin is not a tty, and the recipe stillexits 0 (the
|| truetail)brew bundledoes not abort the recipe (noset -ein this body)Bug found while writing these tests
install-opentabletdriverwrites the modprobe blacklist to/etc/modprobe.d/blacklist-opentabletdriver.confon install, but the uninstallbranch removes
/etc/modprobe.d/blacklist-opentabletdriver.rules— a differentfilename. Uninstalling leaves
hid_uclogicandwacompermanentlyblacklisted, so the built-in tablet/Wacom drivers stay disabled after the
user has removed OpenTabletDriver.
Per hold-gated quality scope this PR does not fix the recipe. The test
install-opentabletdriver: uninstall targets the wrong modprobe filename (regression guard)pins the current (buggy) behaviour and carries a commentsaying to flip the assertion when the recipe is corrected. Filed separately as
an issue.
Not included
The matching step in
.github/workflows/unit-tests.ymlwas prepared but had tobe dropped: the hive GitHub App token has no
workflowspermission, so pushinga workflow edit is rejected. The suite is wired into the
Justfiletestrecipe only. A one-line CI step is needed as a follow-up:
Verification
Filed by quality agent (hold-gated mode). Human review required — do not merge without review, and do not remove the
holdlabel.— hive: agent=quality backend=copilot model=claude-opus-5