-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·56 lines (50 loc) · 1.37 KB
/
test.sh
File metadata and controls
executable file
·56 lines (50 loc) · 1.37 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
set -euo pipefail
prek run --all-files
# Run Python and TypeScript test phases sequentially to avoid cross-runtime
# resource contention that can cause performance-threshold flakes.
uv run pytest
(
cd abxbus-ts
ts_test_file_count=0
while IFS= read -r test_file; do
ts_test_file_count=$((ts_test_file_count + 1))
NODE_OPTIONS='--expose-gc' node --expose-gc --test --import tsx "$test_file"
done < <(find tests -type f -name '*.test.ts' | sort)
if [[ "$ts_test_file_count" -eq 0 ]]; then
echo "No TypeScript test files found in abxbus-ts/tests/" >&2
exit 1
fi
)
shopt -s nullglob
python_example_pids=()
for example_file in examples/*.py; do
timeout 120 uv run python "$example_file" &
python_example_pids+=("$!")
done
for pid in "${python_example_pids[@]}"; do
wait "$pid"
done
(
cd abxbus-ts
shopt -s nullglob
ts_example_pids=()
for example_file in examples/*.ts; do
timeout 120 node --import tsx "$example_file" &
ts_example_pids+=("$!")
done
for pid in "${ts_example_pids[@]}"; do
wait "$pid"
done
)
# Perf suites are expensive and can push total runtime well past the main CI budget.
# Run them explicitly with RUN_PERF=1.
if [[ "${RUN_PERF:-0}" == "1" ]]; then
uv run tests/performance_runtime.py
(
cd abxbus-ts
pnpm run perf
)
else
echo "Skipping perf suites (set RUN_PERF=1 to include them)."
fi