freechat/json-api/run-api-tests.sh

25 lines
449 B
Bash

#!/bin/bash
# First the rtc server
pushd ../rtc-server/
node main.js&
rtc_pid=$!
popd
# Next the json api
cargo run --release -- -s&
json_pid=$!
sleep 2
# Next come back and startup the rest test client
source ./client-tests/bin/activate
python3 client-tests/main.py
# catch errors that may occur and kill off process group
trap "kill $json_pid $rtc_pid" exit INT TERM
# Normal exit (for the most part)
kill -9 $json_pid $rtc_pid
echo Done