Merge branch 'quattro' into add-default-agent
# Conflicts: # migrations/1785633225.sh
This commit is contained in:
@@ -138,7 +138,32 @@ assertDeepEqual(calendar.clockFormatRing('', '', []), ['HH:mm'], 'clock keeps a
|
||||
assertEqual(calendar.nextClockFormat(ring, ring[0]), ring[1], 'clock steps to the next format')
|
||||
assertEqual(calendar.nextClockFormat(ring, ring[ring.length - 1]), ring[0], 'clock wraps the format ring')
|
||||
assertEqual(calendar.nextClockFormat(ring, 'HH:mm:ss'), ring[0], 'clock starts at the top from a format outside the ring')
|
||||
assertEqual(calendar.clockFormats(true)[0], 'HH\n\u2014\nmm', 'clock keeps stacked formats for vertical bars')
|
||||
// Both rings, contents and order: a right click walks this list and writes
|
||||
// the result back to shell.json, so an inserted preset should have to be
|
||||
// acknowledged here.
|
||||
assertDeepEqual(
|
||||
calendar.clockFormats(false),
|
||||
[
|
||||
'dddd HH:mm', 'dddd h:mm AP',
|
||||
'HH:mm', 'h:mm AP',
|
||||
'ddd d MMM HH:mm', 'ddd d MMM h:mm AP',
|
||||
"d MMMM 'W'ww yyyy",
|
||||
// No twin: ISO 8601 writes time on a 24-hour clock, so an AM/PM variant
|
||||
// would contradict the one thing that format is for.
|
||||
'yyyy-MM-dd HH:mm'
|
||||
],
|
||||
'clock offers the horizontal presets in this order'
|
||||
)
|
||||
assertDeepEqual(
|
||||
calendar.clockFormats(true),
|
||||
['HH\n\u2014\nmm', 'h\n\u2014\nmm\nAP', "dd\nMMM\n'W'ww\n''yy", 'HH\nmm'],
|
||||
'clock offers the stacked presets in this order'
|
||||
)
|
||||
assertEqual(
|
||||
calendar.nextClockFormat(ring, 'dddd HH:mm'),
|
||||
'dddd h:mm AP',
|
||||
'clock reaches an AM/PM twin in one right click'
|
||||
)
|
||||
assertEqual(calendar.isoWeekLiteral(2026, 0, 5), '02', 'clock zero-pads the ISO week token')
|
||||
|
||||
// ---- widget wiring
|
||||
|
||||
@@ -104,7 +104,7 @@ source "$ROOT/migrations/1785617047.sh" >/dev/null
|
||||
grep -Fx "$omp_package omp" "$stub_log" >/dev/null || fail "Oh My Pi migration creates a working lazy stub"
|
||||
|
||||
: >"$stub_log"
|
||||
source "$ROOT/migrations/1785633225.sh" >/dev/null
|
||||
source "$ROOT/migrations/1785846769.sh" >/dev/null
|
||||
grep -Fx "$omp_package omp" "$stub_log" >/dev/null || fail "agent migration repairs the Oh My Pi lazy stub"
|
||||
grep -Fx "$grok_package grok" "$stub_log" >/dev/null || fail "agent migration creates the Grok lazy stub"
|
||||
grep -Fx "$crush_package" "$stub_log" >/dev/null || fail "agent migration creates the Crush lazy stub"
|
||||
@@ -114,7 +114,7 @@ touch "$test_home/.local/state/omarchy/preinstalls-removed"
|
||||
"$ROOT/bin/omarchy-mise-install" oh-my-pi omp
|
||||
: >"$stub_log"
|
||||
source "$ROOT/migrations/1785617047.sh" >/dev/null
|
||||
source "$ROOT/migrations/1785633225.sh" >/dev/null
|
||||
source "$ROOT/migrations/1785846769.sh" >/dev/null
|
||||
[[ ! -s $stub_log ]] || fail "agent migrations respect the preinstall opt-out"
|
||||
[[ ! -e $test_home/.local/bin/omp ]] || fail "agent migration removes the obsolete Oh My Pi wrapper after opt-out"
|
||||
rm "$test_home/.local/state/omarchy/preinstalls-removed"
|
||||
|
||||
@@ -14,7 +14,9 @@ fake_hyprctl="$test_tmp/hyprctl"
|
||||
signature="test-signature"
|
||||
runtime_dir="$run_root/1000"
|
||||
|
||||
mkdir -p "$runtime_dir/hypr/$signature"
|
||||
dead_signature="dead-signature"
|
||||
|
||||
mkdir -p "$runtime_dir/hypr/$signature" "$runtime_dir/hypr/$dead_signature"
|
||||
|
||||
cat >"$fake_hyprctl" <<'BASH'
|
||||
#!/bin/bash
|
||||
@@ -22,6 +24,10 @@ cat >"$fake_hyprctl" <<'BASH'
|
||||
printf '%s\t%s\n' "$XDG_RUNTIME_DIR" "$*" >>"$FAKE_HYPRCTL_LOG"
|
||||
|
||||
case "$*" in
|
||||
*'--instance dead-signature '*)
|
||||
printf "Couldn't connect to %s/hypr/dead-signature/.socket.sock. (4)\n" "$XDG_RUNTIME_DIR"
|
||||
exit 4
|
||||
;;
|
||||
*'getoption misc.disable_autoreload'*)
|
||||
printf '{"option":"misc.disable_autoreload","bool":%s,"set":true}\n' "${FAKE_DISABLE_AUTORELOAD:-false}"
|
||||
;;
|
||||
@@ -39,7 +45,7 @@ FAKE_HYPRCTL_LOG="$hyprctl_log" \
|
||||
HYPRCTL="$fake_hyprctl" \
|
||||
OMARCHY_HYPRLAND_RELOAD_GUARD_RUN_ROOT="$run_root" \
|
||||
OMARCHY_HYPRLAND_RELOAD_GUARD_STATE_DIR="$state_dir" \
|
||||
"$ROOT/bin/omarchy-hyprland-reload-guard" pause
|
||||
"$ROOT/bin/omarchy-hyprland-reload-guard" pause 2>"$test_tmp/pause-stderr"
|
||||
|
||||
state_file="$state_dir/$signature"
|
||||
[[ -f $state_file ]] || fail "reload guard stores Hyprland state on pause"
|
||||
@@ -48,6 +54,10 @@ grep -Fx "$expected_state" "$state_file" >/dev/null || fail "reload guard record
|
||||
grep -F 'hl.config({ misc = { disable_autoreload = true }, debug = { suppress_errors = true } })' "$hyprctl_log" >/dev/null || fail "reload guard pauses autoreload with hyprctl eval"
|
||||
pass "reload guard pauses live Hyprland reloads"
|
||||
|
||||
[[ ! -e $state_dir/$dead_signature ]] || fail "reload guard skips instances hyprctl cannot reach"
|
||||
[[ ! -s $test_tmp/pause-stderr ]] || fail "reload guard pauses dead Hyprland instances quietly" "$(cat "$test_tmp/pause-stderr")"
|
||||
pass "reload guard skips dead Hyprland instances quietly"
|
||||
|
||||
: >"$hyprctl_log"
|
||||
FAKE_HYPRCTL_LOG="$hyprctl_log" \
|
||||
HYPRCTL="$fake_hyprctl" \
|
||||
|
||||
@@ -10,7 +10,9 @@ mkdir -p "$tmp/bin"
|
||||
|
||||
cat >"$tmp/bin/nmcli" <<'EOF'
|
||||
#!/bin/bash
|
||||
if [[ $* == *GENERAL.CON-UUID* ]]; then
|
||||
if [[ $* == *"DEVICE,TYPE,STATE"* ]]; then
|
||||
printf 'eth0:ethernet:connected\nwlan0:wifi:connected\n'
|
||||
elif [[ $* == *GENERAL.CON-UUID* ]]; then
|
||||
echo test-uuid
|
||||
else
|
||||
printf '%s' "$QR_NMCLI_FIELDS"
|
||||
@@ -30,11 +32,12 @@ chmod +x "$tmp/bin/nmcli" "$tmp/bin/qrencode"
|
||||
|
||||
run_success_case() {
|
||||
local description=$1 fields=$2 expected_payload=$3
|
||||
shift 3
|
||||
local expected output payload
|
||||
|
||||
export QR_NMCLI_FIELDS=$fields
|
||||
export QR_PAYLOAD_FILE="$tmp/payload"
|
||||
output=$(PATH="$tmp/bin:$PATH" "$ROOT/bin/omarchy-network-qr" wlan0)
|
||||
output=$(PATH="$tmp/bin:$PATH" "$ROOT/bin/omarchy-network-qr" "$@")
|
||||
expected=$'100\n010\n001'
|
||||
[[ $output == "$expected" ]] || fail "$description emits a compact module matrix" "expected: $expected\nactual: $output"
|
||||
|
||||
@@ -46,24 +49,34 @@ run_success_case() {
|
||||
run_success_case \
|
||||
"network QR helper escapes WPA credentials through stdin" \
|
||||
$'Cafe;Guest\\5G\nwpa-psk\np,a:ss;word\\42\nno\n' \
|
||||
'WIFI:T:WPA;S:Cafe\;Guest\\5G;P:p\,a\:ss\;word\\42;;'
|
||||
'WIFI:T:WPA;S:Cafe\;Guest\\5G;P:p\,a\:ss\;word\\42;;' \
|
||||
wlan0
|
||||
|
||||
# With no interface argument the helper finds the connected Wi-Fi device.
|
||||
run_success_case \
|
||||
"network QR helper detects the Wi-Fi interface" \
|
||||
$'Cafe Detected\nwpa-psk\nsecret\nno\n' \
|
||||
'WIFI:T:WPA;S:Cafe Detected;P:secret;;'
|
||||
|
||||
run_success_case \
|
||||
"network QR helper supports open networks" \
|
||||
$'Cafe Open\nnone\n\nno\n' \
|
||||
'WIFI:T:nopass;S:Cafe Open;P:;;'
|
||||
'WIFI:T:nopass;S:Cafe Open;P:;;' \
|
||||
wlan0
|
||||
|
||||
run_success_case \
|
||||
"network QR helper marks hidden networks" \
|
||||
$'Hidden Network\nwpa-psk\nsecret\nyes\n' \
|
||||
'WIFI:T:WPA;S:Hidden Network;P:secret;H:true;;'
|
||||
'WIFI:T:WPA;S:Hidden Network;P:secret;H:true;;' \
|
||||
wlan0
|
||||
|
||||
# NetworkManager models WEP as key-mgmt "none" plus a wep-key, which must not
|
||||
# be mistaken for an open network.
|
||||
run_success_case \
|
||||
"network QR helper encodes WEP networks" \
|
||||
$'Old Router\nnone\n\nno\nwep-secret\n' \
|
||||
'WIFI:T:WEP;S:Old Router;P:wep-secret;;'
|
||||
'WIFI:T:WEP;S:Old Router;P:wep-secret;;' \
|
||||
wlan0
|
||||
|
||||
export QR_NMCLI_FIELDS=$'Enterprise\nwpa-eap\nsecret\nno\n'
|
||||
export QR_PAYLOAD_FILE="$tmp/enterprise-payload"
|
||||
|
||||
@@ -85,7 +85,6 @@ assertDeepEqual(
|
||||
|
||||
assertEqual(network.formatBytes(1536), '1.5 KB', 'network formats bytes')
|
||||
assertEqual(network.formatRate(1536), '1.5 KB/s', 'network formats rates')
|
||||
assertEqual(network.formatSpeedMbps('250.4'), '250 Mbps', 'network formats speed test results')
|
||||
assertEqual(network.formatPingLatency('2.54'), '2.5 ms', 'network formats low ping with precision')
|
||||
assertEqual(network.formatPingLatency('25.4'), '25 ms', 'network formats ping')
|
||||
assertEqual(network.formatPingLatency(''), 'Timeout', 'network formats missing ping as timeout')
|
||||
|
||||
@@ -234,13 +234,8 @@ pass "alert removal handles the older indicators key"
|
||||
fail "alert removal leaves an already-empty list alone" "$(jq -c '.bar.layout.right[1]' "$shell_config")"
|
||||
pass "alert removal leaves an already-empty list alone"
|
||||
|
||||
(($(wc -l <"$SHELL_RESTARTS") == 1)) || fail "alert removal restarts the shell"
|
||||
[[ ! -s $STATE_CALLS ]] || fail "a restarted shell needs no deferred restart" "$(cat "$STATE_CALLS")"
|
||||
pass "alert removal restarts the shell"
|
||||
|
||||
# Migrations run from a TTY or over ssh have no shell to restart, and stopping
|
||||
# there would strand every migration queued behind this one.
|
||||
reset_home
|
||||
SHELL_RESTART_STATUS=1 run_migration
|
||||
grep -Fxq 'set restart-shell-required' "$STATE_CALLS" || fail "an unavailable shell defers its restart" "$(cat "$STATE_CALLS")"
|
||||
pass "an unavailable shell defers its restart"
|
||||
# The running shell hot-reloads shell.json and the post-update restart is
|
||||
# unconditional, so the migration itself never touches the shell.
|
||||
[[ ! -s $SHELL_RESTARTS ]] || fail "alert removal leaves shell restarts to the update" "$(cat "$SHELL_RESTARTS")"
|
||||
[[ ! -s $STATE_CALLS ]] || fail "alert removal defers no shell restart" "$(cat "$STATE_CALLS")"
|
||||
pass "alert removal leaves shell restarts to the update"
|
||||
|
||||
Reference in New Issue
Block a user