mirror of https://github.com/docker/compose.git
Add test coverage support
Prints out results on console and puts HTML report in `coverage-html`. Signed-off-by: Ben Firshman <ben@firshman.co.uk>
This commit is contained in:
parent
81707ef1ad
commit
aab6df6ba4
|
@ -2,3 +2,4 @@
|
|||
build
|
||||
dist
|
||||
venv
|
||||
coverage-html
|
||||
|
|
|
@ -6,3 +6,4 @@
|
|||
/docs/_site
|
||||
/venv
|
||||
docker-compose.spec
|
||||
coverage-html
|
||||
|
|
|
@ -4,3 +4,4 @@ git+https://github.com/pyinstaller/pyinstaller.git@12e40471c77f588ea5be352f7219c
|
|||
unittest2==0.8.0
|
||||
flake8==2.3.0
|
||||
pep8==1.6.1
|
||||
coverage==3.7.1
|
||||
|
|
|
@ -5,6 +5,8 @@ set -ex
|
|||
|
||||
TAG="docker-compose:$(git rev-parse --short HEAD)"
|
||||
|
||||
rm -rf coverage-html
|
||||
|
||||
docker build -t "$TAG" .
|
||||
docker run \
|
||||
--rm \
|
||||
|
@ -12,6 +14,7 @@ docker run \
|
|||
-e DOCKER_VERSIONS \
|
||||
-e "TAG=$TAG" \
|
||||
-e "affinity:image==$TAG" \
|
||||
-e "COVERAGE_DIR=$(pwd)/coverage-html" \
|
||||
--entrypoint="script/test-versions" \
|
||||
"$TAG" \
|
||||
"$@"
|
||||
|
|
|
@ -19,8 +19,9 @@ for version in $DOCKER_VERSIONS; do
|
|||
--rm \
|
||||
--privileged \
|
||||
--volume="/var/lib/docker" \
|
||||
--volume="${COVERAGE_DIR:-$(pwd)/coverage-html}:/code/coverage-html" \
|
||||
-e "DOCKER_VERSION=$version" \
|
||||
--entrypoint="script/dind" \
|
||||
"$TAG" \
|
||||
script/wrapdocker nosetests "$@"
|
||||
script/wrapdocker nosetests --with-coverage --cover-branches --cover-package=compose --cover-erase --cover-html-dir=coverage-html --cover-html "$@"
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue