Skip to content

Commit fb85bf2

Browse files
committed
setup: update makefile and pytest.ini to add functionnal test
1 parent 284ba0c commit fb85bf2

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

Makefile

+22-9
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ venv: check ## create virtualenv in PANDORA_VENV directory if not exists
6060
@${PANDORA_VENV}/bin/python -m pip install --upgrade pip meson-python meson ninja setuptools_scm setuptools wheel pybind11 # no check to upgrade each time
6161
@touch ${PANDORA_VENV}/bin/activate
6262

63-
.PHONY: cpp_deps
64-
cpp_deps: ## retrieve cpp dependencies
65-
@${PANDORA_VENV}/bin/meson wrap update-db
66-
6763
.PHONY: install
6864
install: venv ## install pandora without plugins
6965
@test -f ${PANDORA_VENV}/bin/pandora || . ${PANDORA_VENV}/bin/activate; ${PANDORA_VENV}/bin/pip install --no-build-isolation --editable .[dev,docs,notebook] --config-settings=setup-args=-Dbuild_cpp_tests=enabled
@@ -72,16 +68,38 @@ install: venv ## install pandora without plugins
7268
@echo "PANDORA installed in dev mode in virtualenv ${PANDORA_VENV}"
7369
@echo "PANDORA venv usage : source ${PANDORA_VENV}/bin/activate; pandora -h"
7470

71+
.PHONY: install-sgm
72+
install-sgm: venv install## install pandora with sgm
73+
@test -f ${PANDORA_VENV}/lib/python3.10/site-packages/pandora_plugin_libsgm || . ${PANDORA_VENV}/bin/activate; ${PANDORA_VENV}/bin/pip install --no-build-isolation --editable .[sgm] --config-settings=setup-args=-Dbuild_cpp_tests=enabled
74+
@test -f .git/hooks/pre-commit || echo " Install pre-commit hook"
75+
@test -f .git/hooks/pre-commit || ${PANDORA_VENV}/bin/pre-commit install
76+
@echo "PANDORA installed in dev mode in virtualenv ${PANDORA_VENV} with sgm"
77+
@echo "PANDORA venv usage : source ${PANDORA_VENV}/bin/activate; pandora -h"
78+
7579
## Test section
7680

7781
.PHONY: test
7882
test: install ## run all tests (except notebooks) + coverage (source venv before)
7983
@${PANDORA_VENV}/bin/pytest -m "not notebook_tests" --junitxml=pytest-report.xml --cov-config=.coveragerc --cov-report xml --cov
8084

85+
.PHONY: test-unit-cpp
86+
test-unit-cpp: install ## run unit cpp tests only for dev
87+
@echo "Run unit cpp tests"
88+
. ${PANDORA_VENV}/bin/activate; meson test -C build/$(shell ls build)/ -v
89+
90+
.PHONY: test-functional
91+
test-functional: install-sgm ## run functional tests only (for wheel validation temporary)
92+
@echo "Run functional tests"
93+
@${PANDORA_VENV}/bin/pytest -m "functional_tests"
94+
8195
.PHONY: test-notebook
8296
test-notebook: install ## run notebook tests only
8397
@${PANDORA_VENV}/bin/pytest -m "notebook_pandora"
8498

99+
.PHONY: test-notebook-sgm
100+
test-notebook-sgm: install-sgm ## run notebook tests with sgm as dependency
101+
@${PANDORA_VENV}/bin/pytest -m "notebook_with_sgm"
102+
85103
## Code quality, linting section
86104

87105
### Format with black
@@ -211,8 +229,3 @@ clean-docker: ## clean docker image
211229
@@[ "${CHECK_DOCKER}" ] || ( echo ">> docker not found"; exit 1 )
212230
@echo "Clean Docker image cnes/pandora dev"
213231
@docker image rm cnes/pandora:dev
214-
215-
.PHONY: test-unit-cpp
216-
test-unit-cpp: install ## run unit cpp tests only for dev
217-
@echo "Run unit cpp tests"
218-
. ${PANDORA_VENV}/bin/activate; meson test -C build/$(shell ls build)/ -v

pytest.ini

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ markers =
44
notebook_tests: Notebook unit tests
55
notebook_pandora: Notebook unit tests with Pandora as only dependency (no plugins)
66
notebook_with_sgm: Notebook unit tests with plugin_libsgm dependency
7+
functional_tests: functional tests
78
testpaths = tests
89
norecursedirs = .git doc conf .gitlab
910

0 commit comments

Comments
 (0)