-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·30 lines (27 loc) · 1.18 KB
/
Copy pathrun_tests.sh
File metadata and controls
executable file
·30 lines (27 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Run the full test suite. The stdio screenshot round-trip (AC3) needs an X
# display: if DISPLAY is already set (e.g. the runner's :10) we use it; otherwise
# we wrap the run in a headless Xvfb via xvfb-run so AC3 still exercises.
set -euo pipefail
cd "$(dirname "$0")"
# Regenerate the manifest + schema doc and, inside a git checkout, fail if they
# were committed stale.
python3 scripts/build_manifest.py >/dev/null
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
if ! git diff --quiet -- plugin.json docs/computer-use-mcp-tools-schema.md; then
echo "ERROR: plugin.json / schema doc are stale — run scripts/build_manifest.py and commit." >&2
git --no-pager diff -- plugin.json docs/computer-use-mcp-tools-schema.md >&2 || true
exit 1
fi
fi
run() { python3 -m unittest discover -s tests -v; }
if [ -n "${DISPLAY:-}" ]; then
echo "Using existing DISPLAY=$DISPLAY"
run
elif command -v xvfb-run >/dev/null 2>&1; then
echo "No DISPLAY; running under xvfb-run"
xvfb-run -a --server-args="-screen 0 1920x1080x24" bash -c "$(declare -f run); run"
else
echo "No DISPLAY and no xvfb-run; the screenshot round-trip (AC3) will be skipped." >&2
run
fi