From 8ffb498168d0369c306401bd0b6692c65a43f2ae Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 25 May 2026 15:16:53 +0200 Subject: [PATCH] Move shell tests under shell runner --- .../config-test.sh} | 17 ++++++----------- .../fixtures}/indicator-contract/shell.qml | 0 .../indicator-contract-test.sh} | 18 ++++++------------ .../runtime-smoke-test.sh} | 14 ++++---------- 4 files changed, 16 insertions(+), 33 deletions(-) rename test/{omarchy-shell-config-test.sh => shell.d/config-test.sh} (95%) rename test/{qml => shell.d/fixtures}/indicator-contract/shell.qml (100%) rename test/{omarchy-shell-qml-contract-test.sh => shell.d/indicator-contract-test.sh} (85%) rename test/{omarchy-shell-runtime-smoke-test.sh => shell.d/runtime-smoke-test.sh} (94%) diff --git a/test/omarchy-shell-config-test.sh b/test/shell.d/config-test.sh similarity index 95% rename from test/omarchy-shell-config-test.sh rename to test/shell.d/config-test.sh index 5755f56e..dc2047de 100755 --- a/test/omarchy-shell-config-test.sh +++ b/test/shell.d/config-test.sh @@ -2,25 +2,20 @@ set -euo pipefail -ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) +source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" + TMPDIR="" export PATH="$ROOT/bin:$PATH" -pass() { - printf 'ok - %s\n' "$1" -} - -fail() { - printf 'not ok - %s\n' "$1" >&2 - exit 1 -} - cleanup() { [[ -n $TMPDIR && -d $TMPDIR ]] && rm -rf "$TMPDIR" } trap cleanup EXIT +require_command jq +require_command python3 + jq empty "$ROOT/config/omarchy/shell.json" pass "default shell.json is valid JSON" @@ -94,7 +89,7 @@ if missing or bad: PY pass "default bar widget ids resolve to manifests and entry points" -migration=$(grep -rl 'Place the system update indicator next to weather in the bar' "$ROOT/migrations" | head -n 1) +migration=$(grep -rl 'Place the system update indicator next to weather in the bar' "$ROOT/migrations" | head -n 1 || true) [[ -n $migration ]] || fail "update placement migration exists" TMPDIR=$(mktemp -d) diff --git a/test/qml/indicator-contract/shell.qml b/test/shell.d/fixtures/indicator-contract/shell.qml similarity index 100% rename from test/qml/indicator-contract/shell.qml rename to test/shell.d/fixtures/indicator-contract/shell.qml diff --git a/test/omarchy-shell-qml-contract-test.sh b/test/shell.d/indicator-contract-test.sh similarity index 85% rename from test/omarchy-shell-qml-contract-test.sh rename to test/shell.d/indicator-contract-test.sh index 5bd7ce12..3746c09c 100755 --- a/test/omarchy-shell-qml-contract-test.sh +++ b/test/shell.d/indicator-contract-test.sh @@ -2,19 +2,11 @@ set -euo pipefail -ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) +source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" + TMPDIR="" QS_PID="" -pass() { - printf 'ok - %s\n' "$1" -} - -fail() { - printf 'not ok - %s\n' "$1" >&2 - exit 1 -} - cleanup() { if [[ -n $QS_PID ]] && kill -0 "$QS_PID" 2>/dev/null; then kill "$QS_PID" 2>/dev/null || true @@ -29,12 +21,14 @@ if ! command -v quickshell >/dev/null 2>&1; then exit 0 fi +require_command jq + TMPDIR=$(mktemp -d) result="$TMPDIR/result.json" log="$TMPDIR/quickshell.log" config_dir="$TMPDIR/indicator-contract" -mkdir -p "$config_dir" -cp "$ROOT/test/qml/indicator-contract/shell.qml" "$config_dir/shell.qml" +mkdir -p "$config_dir" "$TMPDIR/home" +cp "$SHELL_TEST_DIR/fixtures/indicator-contract/shell.qml" "$config_dir/shell.qml" ln -s "$ROOT/shell/Ui" "$config_dir/Ui" ln -s "$ROOT/shell/Commons" "$config_dir/Commons" diff --git a/test/omarchy-shell-runtime-smoke-test.sh b/test/shell.d/runtime-smoke-test.sh similarity index 94% rename from test/omarchy-shell-runtime-smoke-test.sh rename to test/shell.d/runtime-smoke-test.sh index 550a8fb8..c0d0aeff 100755 --- a/test/omarchy-shell-runtime-smoke-test.sh +++ b/test/shell.d/runtime-smoke-test.sh @@ -2,19 +2,11 @@ set -euo pipefail -ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) +source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" + TMPDIR="" QS_PID="" -pass() { - printf 'ok - %s\n' "$1" -} - -fail() { - printf 'not ok - %s\n' "$1" >&2 - exit 1 -} - cleanup() { if [[ -n $QS_PID ]] && kill -0 "$QS_PID" 2>/dev/null; then kill "$QS_PID" 2>/dev/null || true @@ -34,6 +26,8 @@ if ! command -v quickshell >/dev/null 2>&1; then exit 0 fi +require_command jq + TMPDIR=$(mktemp -d) test_root="$TMPDIR/omarchy" test_home="$TMPDIR/home"