Added Makefile target to run the tests using the docker image locally.
This commit is contained in:
parent
dbd47b0558
commit
4a4126be47
14
Makefile
14
Makefile
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue