forked from Mergifyio/mergify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-tests.sh
executable file
·47 lines (35 loc) · 1.28 KB
/
run-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
cleanup(){
[ -n "$worker0_pid" ] && kill $worker0_pid || true
[ -n "$worker1_pid" ] && kill $worker1_pid || true
[ -n "$worker2_pid" ] && kill $worker2_pid || true
[ -n "$worker3_pid" ] && kill $worker3_pid || true
[ -n "$worker_beat_pid" ] && kill $worker_beat_pid || true
[ -n "$bridge_pid" ] && kill -9 $bridge_pid || true
[ -n "$wsgi_pid" ] && kill -9 $wsgi_pid || true
[ -n "$exporter_pid" ] && kill -9 $exporter_pid || true
}
trap "cleanup" exit
set -e
if [ "$MERGIFYENGINE_WEBHOOK_SECRET" == "X" ]; then
echo "Error: environment variables are not setuped"
exit 1
fi
mergify-exporter &
exporter_pid="$!"
celery worker -A mergify_engine.worker -n worker-sub-000@localhost &
worker0_pid="$!"
celery worker -A mergify_engine.worker -n worker-sub-001@localhost &
worker1_pid="$!"
celery worker -A mergify_engine.worker -n worker-free-000@localhost &
worker2_pid="$!"
# For scheduled task
celery worker -A mergify_engine.worker -B &
worker_beat_pid="$!"
mergify-exporter &
exporter_pid="$!"
uwsgi --http 127.0.0.1:8802 --plugin python3 --master --enable-threads --die-on-term --processes 4 --threads 4 --lazy-apps --thunder-lock --wsgi-file mergify_engine/wsgi.py &
wsgi_pid="$!"
python -u mergify_engine/tests/bridge.py "$@" &
bridge_pid="$!"
wait