Keep provisioning tests isolated from application refresh and link the real command-presence helper into the Hermes remover fixture. Cover only selected AI menu/scaffold additions, retained default agents and Dictation placement, and new-user/migration mise pruning parity. (cherry picked from commit 1bd969eb386169e107d0b9f15be4b3e1d2a9b4cb)
63 lines
2.5 KiB
Bash
Executable File
63 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
source "$(dirname "$0")/base-test.sh"
|
|
|
|
test_tmp=$(mktemp -d)
|
|
trap 'rm -rf "$test_tmp"' EXIT
|
|
|
|
mock_bin="$test_tmp/bin"
|
|
mkdir -p "$mock_bin" "$test_tmp/home" "$test_tmp/home/.hermes/profiles/james"
|
|
|
|
for command in xdg-user-dirs-update xdg-settings xdg-mime; do
|
|
printf '#!/bin/bash\nexit 0\n' >"$mock_bin/$command"
|
|
done
|
|
chmod +x "$mock_bin"/*
|
|
|
|
# Isolate both setup leaves and application refresh. Refresh also invokes the
|
|
# mise leaf through OMARCHY_PATH, independently of OMARCHY_INSTALL.
|
|
fixture="$test_tmp/omarchy"
|
|
mkdir -p "$fixture/bin" "$test_tmp/install/user"
|
|
cp "$ROOT/bin/omarchy-provision-user" "$ROOT/bin/omarchy-done" "$fixture/bin/"
|
|
ln -s "$ROOT/default" "$fixture/default"
|
|
printf '#!/bin/bash\nexit 0\n' >"$fixture/bin/omarchy-refresh-applications"
|
|
chmod +x "$fixture/bin/omarchy-refresh-applications"
|
|
: >"$test_tmp/install/user/all.sh"
|
|
|
|
provision() {
|
|
HOME="$test_tmp/home" PATH="$mock_bin:$fixture/bin:$PATH" OMARCHY_PATH="$fixture" \
|
|
OMARCHY_INSTALL="$test_tmp/install" bash "$fixture/bin/omarchy-provision-user" "$@" >/dev/null ||
|
|
fail "omarchy-provision-user finishes"
|
|
}
|
|
provision
|
|
|
|
for skill in omarchy diagnose-crash; do
|
|
link="$test_tmp/home/.hermes/skills/$skill"
|
|
[[ -L $link && $(readlink "$link") == "$fixture/default/agents/skills/$skill" ]] ||
|
|
fail "omarchy-provision-user provisions the $skill skill for Hermes"
|
|
|
|
link="$test_tmp/home/.hermes/profiles/james/skills/$skill"
|
|
[[ -L $link && $(readlink "$link") == "$fixture/default/agents/skills/$skill" ]] ||
|
|
fail "omarchy-provision-user provisions the $skill skill for a Hermes profile"
|
|
done
|
|
|
|
pass "omarchy-provision-user provisions Hermes skills"
|
|
|
|
provision --force
|
|
for skill in omarchy diagnose-crash; do
|
|
for directory in .agents/skills .claude/skills .codex/skills .pi/agent/skills .hermes/skills .hermes/profiles/james/skills; do
|
|
link="$test_tmp/home/$directory/$skill"
|
|
[[ -L $link && $(readlink "$link") == "$fixture/default/agents/skills/$skill" ]] ||
|
|
fail "forced provisioning keeps baseline and Hermes skill links idempotent"
|
|
done
|
|
done
|
|
pass "forced provisioning keeps baseline and Hermes skill links idempotent"
|
|
|
|
rm -rf "$test_tmp/home"
|
|
mkdir -p "$test_tmp/home"
|
|
provision
|
|
[[ ! -e $test_tmp/home/.hermes/profiles ]] || fail "provisioning does not invent Hermes profiles"
|
|
[[ ! -e $test_tmp/home/.gemini ]] || fail "Hermes provisioning does not add unrelated Antigravity setup"
|
|
pass "provisioning without existing profiles adds only the Hermes default skill home"
|