Skip to content

Commit

Permalink
chore: Add 'lf' and 'ff' options to Makefile for pytest configuration (
Browse files Browse the repository at this point in the history
…langflow-ai#4494)

Add 'lf' and 'ff' options to Makefile for pytest configuration
  • Loading branch information
ogabrielluiz authored Nov 11, 2024
1 parent 859b72d commit 6b3bf7b
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ open_browser ?= true
path = src/backend/base/langflow/frontend
workers ?= 1
async ?= true
lf ?= false
ff ?= true
all: help

######################
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 6b3bf7b

Please sign in to comment.