oedb-backend/run_tests.sh
2025-09-15 23:54:04 +02:00

22 lines
No EOL
455 B
Bash
Executable file

#!/bin/bash
# Script to start the server in the background and run tests
echo "Starting the server in the background..."
python3 backend.py > server.log 2>&1 &
SERVER_PID=$!
# Give the server a moment to start
sleep 2
echo "Running tests..."
python3 test_api.py
TEST_RESULT=$?
echo "Stopping the server (PID: $SERVER_PID)..."
kill $SERVER_PID
# Wait for the server to stop
sleep 1
echo "Test completed with exit code: $TEST_RESULT"
exit $TEST_RESULT