Add coverage to proxy for integration tests.
This commit is contained in:
1 parent
77358140d9
commit
6fe69590c4
6 files changed
+28
-12
No files matched your search
@@ -5,7 +5,7 @@
|
||||
start_suite "Boot the proxy should only listen on client's interface"
|
||||
|
||||
# Booting it over unix socket listens on unix socket
|
||||
run_on $HOST1 sudo weave launch-proxy
|
||||
run_on $HOST1 COVERAGE=$COVERAGE sudo -E weave launch-proxy
|
||||
assert_raises "run_on $HOST1 sudo docker -H unix:///var/run/weave.sock ps"
|
||||
assert_raises "proxy docker_on $HOST1 ps" 1
|
||||
weave_on $HOST1 stop-proxy
|
||||
|
||||
+7
-4
@@ -117,8 +117,10 @@ stop_router_on() {
|
||||
# the weave container, which means we a) can't grab coverage
|
||||
# stats, and b) can't inspect the logs when tests fail.
|
||||
docker_on $host stop weave 1>/dev/null 2>&1 || true
|
||||
docker_on $host stop weaveproxy 1>/dev/null 2>&1 || true
|
||||
if [ -n "$COVERAGE" ] ; then
|
||||
collect_coverage $host
|
||||
collect_coverage $host weave
|
||||
collect_coverage $host weaveproxy
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -207,11 +209,12 @@ end_suite() {
|
||||
|
||||
collect_coverage() {
|
||||
host=$1
|
||||
container=$2
|
||||
mkdir -p ./coverage
|
||||
rm -f cover.router.prof
|
||||
docker_on $host cp weave:/home/weave/cover.router.prof . 2>/dev/null || return 0
|
||||
rm -f cover.prof
|
||||
docker_on $host cp $container:/home/weave/cover.prof . 2>/dev/null || return 0
|
||||
# ideally we'd know the name of the test here, and put that in the filename
|
||||
mv cover.router.prof $(mktemp -u ./coverage/integration.XXXXXXXX) || true
|
||||
mv cover.prof $(mktemp -u ./coverage/integration.XXXXXXXX) || true
|
||||
}
|
||||
|
||||
WEAVE=$DIR/../weave
|
||||
|
||||
Reference in new issue
Block a user