Added Makefile target to run the tests using the docker image locally.

This commit is contained in:
Salvador E. Tropea 2020-05-19 12:08:18 -03:00
parent dbd47b0558
commit 4a4126be47
1 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,8 @@
#!/usr/bin/make
PY_COV=python3-coverage
CWD := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))
USER_ID=$(shell id -u)
GROUP_ID=$(shell id -g)
deb:
@ -26,6 +29,17 @@ test_local: lint
$(PY_COV) html
x-www-browser htmlcov/index.html
test_docker_local:
rm -rf output
$(PY_COV) erase
# Run in the same directory to make the __pycache__ valid
# Also change the owner of the files to the current user (we run as root like in GitHub)
docker run --rm -v $(CWD):$(CWD) --workdir="$(CWD)" setsoft/kicad_auto_test:latest \
/bin/bash -c "flake8 . --count --statistics ; pytest-3 --test_dir output ; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/"
$(PY_COV) report
$(PY_COV) html
x-www-browser htmlcov/index.html
deb_clean:
fakeroot debian/rules clean