From 1876d8cd42d3d887a68d77c3c909cc75e4aac324 Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Wed, 24 Jun 2026 02:59:14 -0700 Subject: [PATCH] synth-diagnostic: just run tests, no service management - run-tests.sh: no systemctl start/stop, just runs test-unit.py - synth-diagnostic.service: removed Before=, keeps After=prometheus-exporter (no deadlock risk since run-tests.sh doesn't start services) - justfile deploy: stop pipeline -> restart prometheus -> start synth-diagnostic -> restart pipeline Pipeline starts independently at boot (no After=synth-diagnostic). Diagnostic provides visibility at boot without blocking startup. --- justfile | 3 ++- scripts/run-tests.sh | 13 +++---------- system/synth-diagnostic.service | 4 ---- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/justfile b/justfile index 0478496..d6fd668 100644 --- a/justfile +++ b/justfile @@ -107,7 +107,8 @@ deploy: echo '{{BOARD_PASS}}' | sudo -S systemctl stop midi-bridge pd-synth-onboard led-matrix-viz && \ echo '{{BOARD_PASS}}' | sudo -S systemctl restart prometheus-exporter && \ echo '{{BOARD_PASS}}' | sudo -S systemctl start synth-diagnostic && \ - echo '[OK] Deployed + restarted'" + echo '{{BOARD_PASS}}' | sudo -S systemctl restart midi-bridge pd-synth-onboard led-matrix-viz && \ + echo '[OK] Deployed'" # Start synth (onboard audio) synth-onboard: diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 73babec..18e08a6 100644 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -1,25 +1,18 @@ #!/bin/bash -# run-tests.sh — start services, run tests, clean up on failure +# run-tests.sh — run synth pipeline diagnostics set -euo pipefail BOARD="${BOARD_HOST:-192.168.9.167}" cd /home/arduino/uno-q-audio-synth -echo "[diag] Starting pipeline services for diagnostics..." -sudo systemctl start midi-bridge pd-synth-onboard led-matrix-viz - -echo "[diag] Waiting 3s for services to settle..." -sleep 3 - echo "[diag] Running synth pipeline diagnostics against $BOARD..." python3 scripts/test-unit.py "$BOARD" exit_code=$? if [ $exit_code -eq 0 ]; then - echo "[diag] All tests PASSED — pipeline healthy, leaving services running" + echo "[diag] All tests PASSED" else - echo "[diag] Tests FAILED (exit $exit_code) — stopping pipeline services" - sudo systemctl stop midi-bridge pd-synth-onboard led-matrix-viz + echo "[diag] Tests FAILED (exit $exit_code)" fi exit $exit_code \ No newline at end of file diff --git a/system/synth-diagnostic.service b/system/synth-diagnostic.service index bbccf1a..080f3ef 100644 --- a/system/synth-diagnostic.service +++ b/system/synth-diagnostic.service @@ -2,7 +2,6 @@ Description=Synth pipeline diagnostic — runs unit tests at boot DefaultDependencies=no After=multi-user.target prometheus-exporter.service -Before=midi-bridge.service pd-synth-onboard.service led-matrix-viz.service [Service] Type=oneshot @@ -10,9 +9,6 @@ ExecStart=/home/arduino/uno-q-audio-synth/scripts/run-tests.sh StandardOutput=journal StandardError=journal RemainAfterExit=yes - -# Don't let failures cascade — critical for headless boot -# On failure: services won't start, board stays SSH-accessible FailureAction=none [Install]