Add a smoketest, run on CoreDesktop's with coredesktop-dev
check / lint-and-test (push) Successful in 1m37s
check / packages (push) Successful in 23s

`coredesktop-dev smoketest run --with HamPack` installs HamPack on a VM with
CoreDesktop and checks a fresh install, an update with nothing to do, a
one-app rebuild, a failing build and hampackremove, with smoketest/health
checking every package, Flatpak and app is in place.

HAMPACK_SKIP_WINDOWS_APPS skips the Windows installers, which the test VMs'
desktop would start with no one to click through them; smoketest/setup sets
it in each VM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Young
2026-11-26 10:15:11 -07:00
co-authored by Claude Opus 5.5
parent bc536407c4
commit e8fbe256df
16 changed files with 417 additions and 2 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
# shellcheck disable=SC2034
DESCRIPTION="a fresh install of CoreDesktop, then sibling add HamPack, as the READMEs say"
IMAGE=base
TIER="nightly"
scenario() {
install_chain
health
}
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
# shellcheck disable=SC2034
DESCRIPTION="update with nothing new for HamPack builds and downloads nothing"
IMAGE=installed
TIER="pr"
source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh"
# smoketest_prepare has already updated the machine to the commit under test
scenario() {
local app
cd_update
assert_status 0
while read -r app; do
assert_output " $app $(compiled_version "$app") is up to date."
done < <(compiled_apps)
refute_output " Building "
refute_output " Downloading "
refute_output " Installing:"
health
}
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
# shellcheck disable=SC2034
DESCRIPTION="a new version of one app in compile.conf rebuilds that app and no other"
IMAGE=installed
TIER="pr"
source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh"
# Dump1090 is pinned to a commit with ref=, so a new version= rebuilds the same
# source: the quickest build there is
scenario() {
local old
old="$(compiled_version Dump1090)"
upstream_commit HamPack "Rebuild Dump1090" \
'sed -i "/^\[Dump1090\]/,/^\$/ s/^version=.*/&-smoketest/" compile.conf'
cd_update
assert_status 0
assert_output "Updating Dump1090 from $old to $old-smoketest"
[ "$(grep -c ' Building ' <<< "$OUTPUT")" -eq 1 ] || fail "update built more than Dump1090 (see $LAST_LOG)"
health HamPack
}
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
# shellcheck disable=SC2034
DESCRIPTION="a build that fails is reported, keeps the installed app, and is retried on the next update"
IMAGE=installed
TIER="pr"
source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh"
scenario() {
local old
old="$(compiled_version Dump1090)"
upstream_commit HamPack "Break Dump1090's build" \
'sed -i "/^\[Dump1090\]/,/^\$/ { s/^version=.*/&-smoketest/; s/^steps=/steps=false, /; }" compile.conf'
cd_update
assert_status 1
assert_output "Error: build of Dump1090 failed"
assert_output "HamPack's update.sh failed"
assert_vm "Dump1090 is still installed, at its old version" \
"test -x ~/.local/bin/dump1090 && grep -qx Dump1090=$(q "$old") ~/.local/state/HamPack/.installed_versions"
upstream_commit HamPack "Fix Dump1090's build" 'sed -i "s/^steps=false, /steps=/" compile.conf'
cd_update
assert_status 0
assert_output "Updating Dump1090 from $old to $old-smoketest"
health HamPack
}
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
# shellcheck disable=SC2034
DESCRIPTION="hampackremove removes what HamPack installed and leaves CoreDesktop working"
IMAGE=installed
TIER="pr"
scenario() {
local recorded kept pkg
recorded="$(vm_value 'cat ~/.local/state/HamPack/installed-packages 2> /dev/null || true')"
# It asks to confirm, then (with nothing more on stdin) says no to anything else
run_in_vm hampackremove 'printf "y\n" | TERM=dumb ~/.local/bin/hampackremove'
assert_status 0
assert_output "HamPack has been removed."
assert_vm "HamPack's clone, state and apps are gone" '
! test -e ~/.local/share/siblings/HamPack && ! test -e ~/.local/state/HamPack &&
! test -e ~/.local/bin/direwolf && ! test -e ~/.local/bin/dump1090 &&
! test -e ~/.local/bin/POTACAT.AppImage && ! test -e ~/.local/bin/hampackremove'
refute_vm "graywolf's service is gone" 'systemctl cat graywolf'
# Each package HamPack installed is gone, unless something else needs it
kept="$(sed -n 's/^Kept because other software needs them: //p' <<< "$OUTPUT")"
for pkg in $recorded; do
if vm_exec "pacman -Qq $(q "$pkg")" > /dev/null 2>&1; then
[[ " $kept " == *" $pkg "* ]] || fail "$pkg is still installed, and wasn't reported as kept"
fi
done
echo "ok: HamPack's packages are gone, but for those kept: ${kept:-none}"
health CoreDesktop
cd_update
assert_status 0
health CoreDesktop
}