Skip to content

Commit b3bad11

Browse files
committed
fix up int script
1 parent 9633dae commit b3bad11

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

scripts/integration_test.sh

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#!/bin/bash
2-
32
echo "[INFO] Building mojo binaries.."
43

4+
kill_server() {
5+
pid=$(ps aux | grep "$1" | grep -v grep | awk '{print $2}' | head -n 1)
6+
kill $pid
7+
wait $pid 2>/dev/null
8+
}
9+
510
test_server() {
611
(magic run mojo build -D LB_LOG_LEVEL=DEBUG -I . --debug-level full tests/integration/integration_test_server.mojo) || exit 1
712

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

16-
kill $!
17-
wait $! 2>/dev/null
18-
1921
rm ./integration_test_server
20-
}
21-
22-
kill_fastapi() {
23-
pids=$(ps aux | grep "fastapi dev" | grep -v grep | awk '{print $2}')
24-
kill $(echo $pids | head -n 1)
25-
kill $(echo $pids | head -n 2)
22+
kill_server "integration_test_server"
2623
}
2724

2825
test_client() {
@@ -35,7 +32,7 @@ test_client() {
3532

3633
./integration_test_client
3734
rm ./integration_test_client
38-
kill_fastapi
35+
kill_server "fastapi dev"
3936
}
4037

4138
test_server

0 commit comments

Comments
 (0)