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.
This commit is contained in:
2026-06-24 02:59:14 -07:00
parent 9aead397fd
commit 1876d8cd42
3 changed files with 5 additions and 15 deletions
+2 -1
View File
@@ -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 stop midi-bridge pd-synth-onboard led-matrix-viz && \
echo '{{BOARD_PASS}}' | sudo -S systemctl restart prometheus-exporter && \ echo '{{BOARD_PASS}}' | sudo -S systemctl restart prometheus-exporter && \
echo '{{BOARD_PASS}}' | sudo -S systemctl start synth-diagnostic && \ 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) # Start synth (onboard audio)
synth-onboard: synth-onboard:
+3 -10
View File
@@ -1,25 +1,18 @@
#!/bin/bash #!/bin/bash
# run-tests.sh — start services, run tests, clean up on failure # run-tests.sh — run synth pipeline diagnostics
set -euo pipefail set -euo pipefail
BOARD="${BOARD_HOST:-192.168.9.167}" BOARD="${BOARD_HOST:-192.168.9.167}"
cd /home/arduino/uno-q-audio-synth 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..." echo "[diag] Running synth pipeline diagnostics against $BOARD..."
python3 scripts/test-unit.py "$BOARD" python3 scripts/test-unit.py "$BOARD"
exit_code=$? exit_code=$?
if [ $exit_code -eq 0 ]; then if [ $exit_code -eq 0 ]; then
echo "[diag] All tests PASSED — pipeline healthy, leaving services running" echo "[diag] All tests PASSED"
else else
echo "[diag] Tests FAILED (exit $exit_code) — stopping pipeline services" echo "[diag] Tests FAILED (exit $exit_code)"
sudo systemctl stop midi-bridge pd-synth-onboard led-matrix-viz
fi fi
exit $exit_code exit $exit_code
-4
View File
@@ -2,7 +2,6 @@
Description=Synth pipeline diagnostic — runs unit tests at boot Description=Synth pipeline diagnostic — runs unit tests at boot
DefaultDependencies=no DefaultDependencies=no
After=multi-user.target prometheus-exporter.service After=multi-user.target prometheus-exporter.service
Before=midi-bridge.service pd-synth-onboard.service led-matrix-viz.service
[Service] [Service]
Type=oneshot Type=oneshot
@@ -10,9 +9,6 @@ ExecStart=/home/arduino/uno-q-audio-synth/scripts/run-tests.sh
StandardOutput=journal StandardOutput=journal
StandardError=journal StandardError=journal
RemainAfterExit=yes RemainAfterExit=yes
# Don't let failures cascade — critical for headless boot
# On failure: services won't start, board stays SSH-accessible
FailureAction=none FailureAction=none
[Install] [Install]