Skip to content

Commit

Permalink
fix up int script
Browse files Browse the repository at this point in the history
  • Loading branch information
thatstoasty committed Jan 12, 2025
1 parent 9633dae commit b3bad11
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions scripts/integration_test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash

echo "[INFO] Building mojo binaries.."

kill_server() {
pid=$(ps aux | grep "$1" | grep -v grep | awk '{print $2}' | head -n 1)
kill $pid
wait $pid 2>/dev/null
}

test_server() {
(magic run mojo build -D LB_LOG_LEVEL=DEBUG -I . --debug-level full tests/integration/integration_test_server.mojo) || exit 1

Expand All @@ -13,16 +18,8 @@ test_server() {
echo "[INFO] Testing server with Python client"
magic run python3 tests/integration/integration_client.py

kill $!
wait $! 2>/dev/null

rm ./integration_test_server
}

kill_fastapi() {
pids=$(ps aux | grep "fastapi dev" | grep -v grep | awk '{print $2}')
kill $(echo $pids | head -n 1)
kill $(echo $pids | head -n 2)
kill_server "integration_test_server"
}

test_client() {
Expand All @@ -35,7 +32,7 @@ test_client() {

./integration_test_client
rm ./integration_test_client
kill_fastapi
kill_server "fastapi dev"
}

test_server
Expand Down

0 comments on commit b3bad11

Please sign in to comment.