update: a failing hook without run_update fails the update
shellcheck / shellcheck (push) Failing after 17s
shellcheck / shellcheck (push) Failing after 17s
Since a65f07c ran each hook in a subshell, a hook that does its work as
it's sourced (12-migrations, 15-services, 20-aur, 30-flatpak and others)
had its failure lost: the run_update check after source left the
subshell's status at 0, so update said "Done." and exited 0. The smoketest's
40-failing-migration caught it. update now exits the subshell with the
sourced hook's status.
Also, the smoketest scenarios that check whether a migration ran look for
"Running migration " so install.sh's "Running migrations..." heading
doesn't match (11-refresh failed on it).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,8 @@ scenario() {
|
||||
|
||||
run_in_vm refresh 'TERM=dumb ~/.local/bin/refresh'
|
||||
assert_status 0
|
||||
refute_output "Running migration"
|
||||
# One migration's line, not install.sh's "Running migrations..." heading
|
||||
refute_output "Running migration "
|
||||
|
||||
fingerprint "$SMOKETEST_RESULTS/after.fingerprint"
|
||||
assert_same_fingerprint "$SMOKETEST_RESULTS/before.fingerprint" "$SMOKETEST_RESULTS/after.fingerprint"
|
||||
|
||||
@@ -11,7 +11,8 @@ scenario() {
|
||||
cd_update
|
||||
assert_status 0
|
||||
assert_output "Done."
|
||||
refute_output "Running migration"
|
||||
# One migration's line, not install.sh's "Running migrations..." heading
|
||||
refute_output "Running migration "
|
||||
# install_packages prints this only when it installs something
|
||||
refute_output "Installing:"
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ scenario() {
|
||||
|
||||
cd_update
|
||||
assert_status 0
|
||||
assert_output "Running migration"
|
||||
assert_output "Running migration "
|
||||
cd_update
|
||||
assert_status 0
|
||||
refute_output "Running migration"
|
||||
refute_output "Running migration "
|
||||
|
||||
assert_vm "the migration ran exactly once" '[ "$(cat ~/smoketest-migration)" = ran ]'
|
||||
assert_vm "the migration is recorded" '
|
||||
|
||||
Reference in New Issue
Block a user