69 lines
1.6 KiB
Bash
Executable File
69 lines
1.6 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
ROOT="$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)"
|
|
|
|
need_cmd() {
|
|
if ! command -v "$1" >/dev/null 2>&1; then
|
|
echo "missing required command: $1" >&2
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
need_cmd python3
|
|
need_cmd docker
|
|
need_cmd node
|
|
|
|
cd "$ROOT"
|
|
|
|
echo "[1/6] compile collector-service"
|
|
python3 -m compileall collector-service/app >/dev/null
|
|
|
|
echo "[2/6] run backend contract tests"
|
|
python3 -m unittest \
|
|
tests.test_main_agent_governance \
|
|
tests.test_platform_contracts \
|
|
tests.test_production_baseline >/dev/null
|
|
|
|
echo "[3/6] validate docker compose"
|
|
docker compose config >/dev/null
|
|
|
|
echo "[4/6] validate n8n workflows"
|
|
python3 - <<'PY'
|
|
import json
|
|
import pathlib
|
|
|
|
for path in sorted(pathlib.Path("n8n/workflows").glob("*.json")):
|
|
with path.open() as handle:
|
|
json.load(handle)
|
|
print(f"workflow ok: {path.name}")
|
|
PY
|
|
|
|
echo "[5/6] validate web scripts"
|
|
validate_node_script() {
|
|
for file in "$@"; do
|
|
if [ ! -f "$file" ]; then
|
|
echo "missing required script file: $file" >&2
|
|
exit 1
|
|
fi
|
|
node --check "$file"
|
|
done
|
|
}
|
|
|
|
validate_node_script web/storyforge-web-v4/assets/app.js
|
|
|
|
set -- web/storyforge-web-v4/assets/storyforge-*.js
|
|
if [ "$1" = 'web/storyforge-web-v4/assets/storyforge-*.js' ]; then
|
|
echo "missing required script bundle: web/storyforge-web-v4/assets/storyforge-*.js" >&2
|
|
exit 1
|
|
fi
|
|
validate_node_script "$@"
|
|
node --check scripts/douyin-browser-capture/control_panel.mjs
|
|
|
|
echo "[6/6] validate homepage and workbench tests"
|
|
node --test \
|
|
web/storyforge-web-v4/tests/dashboard-home.test.mjs \
|
|
web/storyforge-web-v4/tests/workbench-pages.test.mjs
|
|
|
|
echo "baseline checks passed"
|