memlnaut-nisps/scripts/run-all-tests.sh
w1n5t0n 3138701100 Stream 11: verification infrastructure (golden vectors + parity + lint + CI + Playwright migration)
Agent ran out of API credits before committing. Files staged + committed by orchestrator. Coverage:
- tests/cpp/ml_golden_vectors.cpp: fixed-seed regression tests for MLP determinism
- tests/cpp/engine_impulse.cpp: white-noise impulse responses with binary baseline
- tests/cpp/parity_check.cpp + parity_wasm.mjs + parity_diff.mjs: native vs WASM bit-equivalence
- scripts/build-cpp-tests.sh, lint-cpp.sh, parity-check.sh, run-all-tests.sh
- playground/tests/e2e/{ml-engine,modes,persistence,ui-interactions}.spec.ts (+helpers)
- .github/workflows/ci.yml

(meml-x06)
2026-04-29 19:50:55 +03:00

61 lines
1.9 KiB
Bash
Executable file

#!/usr/bin/env bash
# scripts/run-all-tests.sh — master entrypoint that exercises every check
# stream 11 owns. Designed to be the single command CI invokes.
#
# Stages (each fails fast):
# 1. C++ build + ctest → scripts/build-cpp-tests.sh
# 2. WASM build → scripts/build-wasm.sh
# 3. Parity check → scripts/parity-check.sh
# 4. Lint → scripts/lint-cpp.sh
# 5. Playground tests → cd playground && bun run typecheck + bunx playwright test
#
# Flags via env:
# NISPS_SKIP_PLAYWRIGHT=1 skip the Playwright leg (useful in C++-only loops)
# NISPS_SKIP_WASM=1 skip WASM build + parity (no emcc available)
# NISPS_LINT_STRICT=1 treat lint warnings as failures
#
# Exit codes: 0 on full success, otherwise the failing stage's exit code.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
stage() { printf '\n=== %s ===\n' "$1"; }
stage "1/5 C++ build + ctest"
"$ROOT/scripts/build-cpp-tests.sh"
if [[ "${NISPS_SKIP_WASM:-0}" != "1" ]]; then
stage "2/5 WASM build"
"$ROOT/scripts/build-wasm.sh"
stage "3/5 parity check"
"$ROOT/scripts/parity-check.sh"
else
stage "2/5 WASM build (skipped: NISPS_SKIP_WASM=1)"
stage "3/5 parity check (skipped: NISPS_SKIP_WASM=1)"
fi
stage "4/5 lint"
"$ROOT/scripts/lint-cpp.sh"
if [[ "${NISPS_SKIP_PLAYWRIGHT:-0}" != "1" ]]; then
stage "5/5 playground tests"
if ! command -v bun >/dev/null 2>&1; then
echo "[run-all-tests] bun not on PATH; skipping playground stage"
else
(
cd "$ROOT/playground"
bun install --frozen-lockfile 2>/dev/null || bun install
bun run typecheck
# Ensure browsers are present. `--with-deps` is heavy; leave to CI.
bunx playwright install chromium >/dev/null 2>&1 || true
bunx playwright test
)
fi
else
stage "5/5 playground tests (skipped: NISPS_SKIP_PLAYWRIGHT=1)"
fi
stage "ALL GREEN"