Files
Epicnabbo-Catalogus-Updated…/src/test/ci-deploy-harness.sh
T
openhands 2a1aef1c1b fix: complete Playwright removal in CI deploy workflow
Drop the leftover Playwright browser install and e2e smoke test from the deployment script, and update the deployment contract tests to cover the verify-deployed-release smoke check instead.
2026-09-08 16:47:39 +02:00

54 lines
1.8 KiB
Bash

# Sourced only by the deployment simulation tests; no external services are used.
git() {
if [ "$1" = rev-parse ]; then printf '%s\n' "$TEST_SHA"; return; fi
local n=0
if [ -f "$TEST_DIR/remote-count" ]; then read -r n < "$TEST_DIR/remote-count"; fi
n=$((n+1)); printf '%s\n' "$n" > "$TEST_DIR/remote-count"
if [ "$SCENARIO" = remote-failure ]; then return 1; fi
if [ "$SCENARIO" = stale ] || { [ "$SCENARIO" = superseded ] && [ "$n" -gt 1 ]; }; then
printf '%s\trefs/heads/main\n' bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
else printf '%s\trefs/heads/main\n' "$TEST_SHA"; fi
}
flock() { echo "lock" >> "$TEST_DIR/calls"; [ "$SCENARIO" != lock-failure ]; }
pnpm() {
echo "pnpm $*" >> "$TEST_DIR/calls"
if [ "$1" = db:migrate ] && [ "$SCENARIO" = migration-failure ]; then return 1; fi
return 0
}
curl() {
if [ "$SCENARIO" = health-failure ] && [ "$(cat "$TEST_DIR/epicnext-cms-app" 2>/dev/null)" = new ]; then return 1; fi
echo '{"database":true}'
}
sleep() { :; }
docker() {
echo "docker $*" >> "$TEST_DIR/calls"
local name="${@: -1}"
case "$1" in
inspect)
[ -f "$TEST_DIR/$name" ] || return 1
if [ "${3:-}" = '{{.State.Running}}' ]; then echo true
elif [ "${3:-}" = '{{.Image}}' ]; then echo sha256:old
fi ;;
build) [ "$SCENARIO" != build-failure ] ;;
stop) return 0 ;;
rename) mv "$TEST_DIR/$2" "$TEST_DIR/$3" ;;
run)
echo new > "$TEST_DIR/epicnext-cms-app"
[ "$SCENARIO" != run-failure ] ;;
start) [ -f "$TEST_DIR/$2" ] ;;
rm) rm -f "$TEST_DIR/$name" ;;
*) return 0 ;;
esac
}
export -f git flock pnpm curl sleep docker
node() {
echo "node $*" >> "$TEST_DIR/calls"
case "$SCENARIO" in
release-failure) return 1 ;;
smoke-failure) case "$*" in *verify-deployed-release.mjs*) return 1 ;; esac ;;
esac
return 0
}
export -f node