[Makefile] Changed default targets for local use

- t1k7 is local
- t1k6 is a docker image
- t1k8 is nightly docker image
This commit is contained in:
Salvador E. Tropea 2023-05-04 11:02:06 -03:00
parent 61a8fe7885
commit 6f8c0c8735
1 changed files with 11 additions and 6 deletions

View File

@ -41,15 +41,17 @@ test_tmp: lint
$(PY_COV) combine
$(PY_COV) report
test: lint
# lint
test:
rm -rf output
rm -f example.kiplot.yaml
rm -f example.kibot.yaml
rm -f tests/.local
$(PY_COV) erase
# python3-pytest-xdist
$(PYTEST) -m "not slow" -n 4 --test_dir=output
$(PYTEST) -m "slow" --test_dir=output
# $(PYTEST) -m "not slow" -n 4 --test_dir=output
$(PYTEST) -m "slow and (not indep)" --test_dir=output
$(PYTEST) -m "slow and indep" --test_dir=output
$(PY_COV) combine
$(PY_COV) report
$(PY_COV) html
@ -106,14 +108,17 @@ test_docker_local_1_ki7:
docker run --rm -v $(CWD):$(CWD) --workdir="$(CWD)" ghcr.io/inti-cmnb/kicad_auto_test:ki7 \
/bin/bash -c "python3-coverage run src/kibot --help-outputs > /dev/null; pytest-3 --log-cli-level debug -k '$(SINGLE_TEST)' --test_dir=output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ tests/.config/kiplot/plugins/__pycache__/ tests/test_plot/fake_pcbnew/__pycache__/ tests/.config/kibot/plugins/__pycache__/ .coverage htmlcov/"
t1k7: test_docker_local_1_ki7
t1k7: single_test
# pip3 uninstall -y kiauto ; dpkg -i kiauto_2.2.5-1_all.deb ;
test_docker_local_1_n:
rm -rf output
rm -f tests/.local
docker run --rm -v $(CWD):$(CWD) --workdir="$(CWD)" ghcr.io/inti-cmnb/kicad_auto_test:nightly \
/bin/bash -c "src/kibot --help-outputs > /dev/null ; pytest-3 --log-cli-level debug -k '$(SINGLE_TEST)' --test_dir=output ; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ tests/.config/kiplot/plugins/__pycache__/ tests/test_plot/fake_pcbnew/__pycache__/ tests/.config/kibot/plugins/__pycache__/ .coverage htmlcov/"
t1k8: t1n
t1n: test_docker_local_1_n
test_docker_local:
@ -135,7 +140,7 @@ test_docker_local_ki6:
# 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)" ghcr.io/inti-cmnb/kicad_auto_test:ki6 \
/bin/bash -c "python3-coverage run src/kibot --help-outputs ; pytest-3 --test_dir=output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ .coverage htmlcov/"
/bin/bash -c "python3-coverage run src/kibot --help-outputs ; pytest-3 --test_dir=output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ .coverage.* htmlcov/"
$(PY_COV) combine
$(PY_COV) report
x-www-browser htmlcov/index.html
@ -166,7 +171,7 @@ docker_shell:
--volume="/home/$(USER):/home/$(USER):rw" \
setsoft/kicad_auto_test:latest /bin/bash
t1k6: single_test
t1k6: test_docker_local_1_ki6
single_test:
rm -rf pp