diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae4a1788..295158bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,15 +56,15 @@ git clone https://github.com/YOUR-GIT-PROFILE/lightspeed-stack.git cd lightspeed-stack # setup your devel environment with uv -uv install -G dev +uv sync --group dev -# Now you can run test commands trough make targets, or prefix the rest of commands with `uv run`, eg. `uv run make test` +# Now you can run test commands trough make targets, or prefix the rest of commands with `uv run`, eg. `uv run make test` or do `uv venv`, which creates virtual environment and prints activation command, and run commands inside venv. # run unit tests -make unit-tests +make test-unit # run integration tests -make integration-tests +make test-integration # code formatting # (this is also run automatically as part of pre-commit hook if configured) diff --git a/Makefile b/Makefile index 04c9b2d9..ae513845 100644 --- a/Makefile +++ b/Makefile @@ -14,12 +14,12 @@ run-data-collector: ## Run the data collector service locally test-unit: ## Run the unit tests @echo "Running unit tests..." @echo "Reports will be written to ${ARTIFACT_DIR}" - COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.unit" uv run pytest tests/unit --cov=src --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_unit.json" --junit-xml="${ARTIFACT_DIR}/junit_unit.xml" --cov-fail-under=60 + COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.unit" uv run python -m pytest tests/unit --cov=src --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_unit.json" --junit-xml="${ARTIFACT_DIR}/junit_unit.xml" --cov-fail-under=60 test-integration: ## Run integration tests tests @echo "Running integration tests..." @echo "Reports will be written to ${ARTIFACT_DIR}" - COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.integration" uv run pytest tests/integration --cov=src --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_integration.json" --junit-xml="${ARTIFACT_DIR}/junit_integration.xml" --cov-fail-under=10 + COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.integration" uv run python -m pytest tests/integration --cov=src --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_integration.json" --junit-xml="${ARTIFACT_DIR}/junit_integration.xml" --cov-fail-under=10 test-e2e: ## Run BDD tests for the service PYTHONDONTWRITEBYTECODE=1 uv run behave --tags=-skip -D dump_errors=true @tests/e2e/test_list.txt \