Files
navidrome-uploader/e2e/test-entrypoint.sh
T
arian 7599093d90
Build Debian Package / build (push) Successful in 7s
feat(e2e): add Dockerfile and entrypoint script for testing deb packages
Signed-off-by: Arian Nasr <arian@2ari.ca>
2026-05-31 08:06:48 -04:00

39 lines
812 B
Bash

#!/bin/sh
export NAVIDROME_MUSIC_FOLDER="/opt/navidrome/music"
export BASE_URL="http://127.0.0.1:5001"
# Start the app manually since systemd isn't running in the container
cd /opt/navidrome-uploader
su -s /bin/sh navidrome-uploader -c "/opt/navidrome-uploader/venv/bin/gunicorn --no-control-socket -c gunicorn.conf.py main:app" &
APP_PID=$!
TIMEOUT=30
SERVICE_UP=0
while [ $TIMEOUT -gt 0 ]; do
if curl -s $BASE_URL/ping | grep -q "pong"; then
SERVICE_UP=1
break
fi
sleep 1
TIMEOUT=$((TIMEOUT-1))
done
if [ $SERVICE_UP -eq 0 ]; then
echo "Error: Service failed to start within the timeout period"
kill $APP_PID
exit 1
fi
cd /e2e
/e2e/venv/bin/pytest unit/api/test_api.py
# Capture the exit code of pytest
TEST_EXIT_CODE=$?
kill $APP_PID
exit $TEST_EXIT_CODE