tests: skip search related tests for now, add new test commands and add pytest-xdist to run in parralel

This commit is contained in:
Andrii V 2025-06-25 20:37:14 +02:00
parent 9bbdde8d18
commit 7dc5b1bc0c
7 changed files with 34 additions and 2 deletions

View file

@ -96,7 +96,31 @@ test-simple:
# test-custom: Run tests without coverage, only run tests matching PATTERN
test-custom:
PYTHONHASHSEED=random \
py.test $(if $(PATTERN),-k "$(PATTERN)",) -vv -r xw -p no:sugar \
py.test -n auto $(if $(PATTERN),-k "$(PATTERN)",) -v -r xw -p no:sugar \
--ignore=rhodecode/tests/vcs_operations \
--ignore=rhodecode/tests/database
.PHONY: test-changed
# test-changed: Run tests for changed files only
test-changed:
@echo "Finding changed Python files..."
@git diff --name-only HEAD~1 | grep '\.py$$' | grep -E '(test_|tests/)' > .changed_tests || true
@if [ -s .changed_tests ]; then \
echo "Running tests for changed files:"; \
cat .changed_tests; \
PYTHONHASHSEED=random py.test -v -p no:sugar $$(cat .changed_tests); \
else \
echo "No test files changed, running quick smoke tests..."; \
make test-smoke; \
fi
@rm -f .changed_tests
.PHONY: test-fast
# test-fast: Fastest possible test execution for development using pytest-xdist parallelism
test-fast:
make test-clean
PYTHONHASHSEED=random PYTHONWARNINGS=ignore py.test -n auto -q -p no:sugar --tb=short \
--ignore=rhodecode/tests/vcs_operations \
--ignore=rhodecode/tests/database