Node tests / test (push) Has been cancelled
Add xmlrpc-client with serializer/parser (fast-xml-parser), local stub tests, and npm run wp:probe-xmlrpc for each configured site wp_url. Reuses WP retry env and exports wpRetryOpts from wordpress.js. Optional OPS_CHECK_XMLRPC=1 in ops-check.sh after wp:test. Publish path remains REST-only; probe validates BIT-353 XML-RPC surface for hosts that disable or restrict REST. Made-with: Cursor
45 lines
1.2 KiB
Bash
Executable File
45 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Post-deploy smoke checks (BIT-353). Run from repo root or via npm run ops:check.
|
|
# RSS is always required. WordPress probe runs only when site JSON (excl. example) or WP_* env trio.
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
echo "=== ops-check: unit tests ==="
|
|
npm test --silent
|
|
|
|
echo ""
|
|
echo "=== ops-check: RSS feeds ==="
|
|
npm run rss:test --silent
|
|
|
|
_should_wp_test=0
|
|
if [[ -n "${WP_URL:-}" && -n "${WP_USER:-}" && -n "${WP_PASSWORD:-}" ]]; then
|
|
_should_wp_test=1
|
|
fi
|
|
if [[ "${_should_wp_test}" -eq 0 ]] && compgen -G "config/sites/*.json" > /dev/null; then
|
|
for _f in config/sites/*.json; do
|
|
[[ -f "${_f}" ]] || continue
|
|
[[ "$(basename "${_f}")" == "example.json" ]] && continue
|
|
_should_wp_test=1
|
|
break
|
|
done
|
|
fi
|
|
|
|
if [[ "${_should_wp_test}" -eq 1 ]]; then
|
|
echo ""
|
|
echo "=== ops-check: WordPress REST ==="
|
|
npm run wp:test --silent
|
|
if [[ "${OPS_CHECK_XMLRPC:-}" == "1" ]]; then
|
|
echo ""
|
|
echo "=== ops-check: WordPress XML-RPC (OPS_CHECK_XMLRPC=1) ==="
|
|
npm run wp:probe-xmlrpc --silent
|
|
fi
|
|
else
|
|
echo ""
|
|
echo "=== ops-check: wp:test skipped (no config/sites/*.json besides example, WP_* not set) ==="
|
|
fi
|
|
|
|
echo ""
|
|
echo "ops-check: all required steps passed."
|