Files
GeuReflector/tests/run_tests.sh
T
Audric ccec8f1e95 logging: facade (hand-rolled async worker) + hot-path migration; drop TRUNK_DEBUG
Adds src/misc/Log.h / Log.cpp exposing geulog::{trace,debug,info,warn,error}
(subsystem, args...) with gate-before-format. Seven named loggers
(trunk, satellite, twin, client, mqtt, redis, core) share a mutex-guarded
deque drained by a single background worker thread writing to fd=1.
Levels come from [GLOBAL] LOG=*=warn,trunk=debug,... and are runtime-
settable via /dev/shm/reflector_ctrl (LOG SHOW / LOG sub=lvl / LOG RESET).
Writes continue to fd=1 so LogWriter file/syslog paths are unchanged.

Migrated hot paths only: audio relay, talker start/stop, handshake,
heartbeat, per-client RX, per-frame trunk/satellite/twin relay, plus the
ENOTCONN sendMsg race at ReflectorClient:302 (demoted to debug since it
is per-disconnect noise, not a fault).

Cold paths (startup banners, config validation, TLS/CA diagnostics,
MQTT/Redis publisher lifecycle) remain on raw cout/cerr and move in the
next commit.

TRUNK_DEBUG is removed; a startup warning points at LOG=trunk=debug.
2026-04-18 18:35:51 +02:00

42 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
cleanup() {
echo "=== Tearing down test environment ==="
docker compose -f docker-compose.test.yml down -v --remove-orphans 2>/dev/null
}
trap cleanup EXIT
echo "=== Generating configs from topology.py ==="
python3 generate_configs.py
echo "=== Building and starting reflector mesh ==="
docker compose -f docker-compose.test.yml up -d --build --wait
echo "=== Running integration tests ==="
python3 test_trunk.py
echo "=== Logging tests ==="
python3 test_logging.py -v || exit 1
echo ""
echo "=================================="
echo "Running TWIN protocol tests"
echo "=================================="
echo "=== Generating TWIN topology configs ==="
python3 generate_configs.py --topology twin
echo "=== Tearing down default mesh ==="
docker compose -f docker-compose.test.yml down -v --remove-orphans
echo "=== Building and starting TWIN mesh ==="
docker compose -f docker-compose.test.yml up -d --build --wait
echo "=== Running TWIN integration tests ==="
python3 test_twin.py
echo "=== Restoring default topology ==="
python3 generate_configs.py