chore: Add 'lf' and 'ff' options to Makefile for pytest configuration (#4494)

Add 'lf' and 'ff' options to Makefile for pytest configuration
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-11-11 15:59:56 -03:00 committed by GitHub
commit 6b3bf7b523
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,6 +19,8 @@ open_browser ?= true
path = src/backend/base/langflow/frontend
workers ?= 1
async ?= true
lf ?= false
ff ?= true
all: help
######################
@ -130,26 +132,20 @@ endif
coverage: ## run the tests and generate a coverage report
@uv run coverage run
@uv run coverage erase
#@poetry run coverage run
#@poetry run coverage erase
unit_tests: ## run unit tests
@uv sync --extra dev --frozen
ifeq ($(async), true)
uv run pytest src/backend/tests \
--ignore=src/backend/tests/integration \
--instafail -n auto -ra -m "not api_key_required" \
--durations-path src/backend/tests/.test_durations \
--splitting-algorithm least_duration \
$(args)
else
uv run pytest src/backend/tests \
--ignore=src/backend/tests/integration \
--instafail -ra -m "not api_key_required" \
--durations-path src/backend/tests/.test_durations \
--splitting-algorithm least_duration \
$(args)
endif
@EXTRA_ARGS=""
@if [ "$(async)" = "true" ]; then \
EXTRA_ARGS="$$EXTRA_ARGS --instafail -n auto"; \
fi; \
if [ "$(lf)" = "true" ]; then \
EXTRA_ARGS="$$EXTRA_ARGS --lf"; \
fi; \
if [ "$(ff)" = "true" ]; then \
EXTRA_ARGS="$$EXTRA_ARGS --ff"; \
fi; \
uv run pytest src/backend/tests --ignore=src/backend/tests/integration $$EXTRA_ARGS --instafail -ra -m 'not api_key_required' --durations-path src/backend/tests/.test_durations --splitting-algorithm least_duration $(args)
unit_tests_looponfail:
@make unit_tests args="-f"