-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·48 lines (41 loc) · 1.01 KB
/
test.sh
File metadata and controls
executable file
·48 lines (41 loc) · 1.01 KB
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
48
#!/bin/bash
set -e
# a helper script to run tests in the appropriate directories
for dir in nsqd nsqlookupd util/pqueue; do
echo "testing $dir"
pushd $dir >/dev/null
go test -test.v -timeout 15s
popd >/dev/null
done
# build and run nsqlookupd
pushd nsqlookupd >/dev/null
go build
echo "starting nsqlookupd"
./nsqlookupd >/dev/null 2>&1 &
LOOKUPD_PID=$!
popd >/dev/null
# build and run nsqd configured to use our lookupd above
pushd nsqd >/dev/null
go build
rm -f *.dat
echo "starting nsqd --data-path=/tmp --lookupd-tcp-address=127.0.0.1:4160"
./nsqd --data-path=/tmp --lookupd-tcp-address=127.0.0.1:4160 >/dev/null 2>&1 &
NSQD_PID=$!
popd >/dev/null
sleep 0.3
cleanup() {
kill -s TERM $NSQD_PID
kill -s TERM $LOOKUPD_PID
}
trap cleanup INT TERM EXIT
pushd nsq >/dev/null
echo "testing nsq"
go test -v -timeout 15s
popd >/dev/null
# no tests, but a build is something
for dir in nsqadmin nsqlookupd examples/*; do
pushd $dir >/dev/null
echo "building $dir"
go build
popd >/dev/null
done