Fix reporting of coverage results to coverall.io
When I re-arranged the test-in-docker I didn't realize how .travis.yml was extracting the results. This should fix it. When running with test-in-docker we mount the source read-only on /linux-ro/ inside the container and copy it over to /lorax/ for running the tests. The local directory ./.test-results/ is mounted on /test-results/ in the container and the .coverage file is copied into there so that it is available on the host.
This commit is contained in:
parent
6ae78fbd47
commit
b61a91954a
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ __pycache__/
|
||||
.coverage
|
||||
pylint-log
|
||||
.pytest_cache/
|
||||
.test-results/
|
||||
|
@ -9,9 +9,7 @@ script:
|
||||
after_success:
|
||||
- |
|
||||
|
||||
sudo docker create --name results-cont welder/lorax /bin/echo
|
||||
sudo docker cp results-cont:/lorax/.coverage .coverage.docker
|
||||
sudo docker rm results-cont
|
||||
cp .test-results/.coverage ./.coverage.docker
|
||||
|
||||
pip install coverage coveralls
|
||||
coverage combine
|
||||
|
@ -32,5 +32,6 @@ RUN dnf -y install \
|
||||
which && \
|
||||
touch /.in-container
|
||||
RUN useradd weldr
|
||||
VOLUME /lorax
|
||||
WORKDIR /lorax
|
||||
VOLUME /lorax-ro
|
||||
VOLUME /test-results
|
||||
WORKDIR /lorax-ro
|
||||
|
7
Makefile
7
Makefile
@ -77,12 +77,13 @@ local:
|
||||
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
|
||||
|
||||
test-in-copy:
|
||||
rsync -aP --exclude=.git /lorax/ /lorax-test/
|
||||
make -C /lorax-test/ check test
|
||||
rsync -aP --exclude=.git /lorax-ro/ /lorax/
|
||||
make -C /lorax/ check test
|
||||
cp /lorax/.coverage /test-results/
|
||||
|
||||
test-in-docker:
|
||||
sudo $(DOCKER) build -t welder/lorax-tests:$(IMAGE_RELEASE) -f Dockerfile.test .
|
||||
sudo $(DOCKER) run --rm -it -v `pwd`:/lorax:ro --security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make test-in-copy
|
||||
sudo $(DOCKER) run --rm -it -v `pwd`/.test-results/:/test-results -v `pwd`:/lorax-ro:ro --security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make test-in-copy
|
||||
|
||||
docs-in-docker:
|
||||
sudo $(DOCKER) run -it --rm -v `pwd`/docs/html/:/lorax/docs/html/ --security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make docs
|
||||
|
Loading…
Reference in New Issue
Block a user