Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,27 @@ jobs:
env:
DO_NOT_TRACK: true # disable telemetry reporting

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: matrix.python-version == '3.10'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./src/lfx/coverage.xml
flags: lfx
name: lfx-coverage
fail_ci_if_error: false
directory: ./src/lfx/

- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
if: matrix.python-version == '3.10'
with:
name: lfx-coverage-report
path: |
src/lfx/coverage.xml
src/lfx/htmlcov/
retention-days: 30

test-cli:
name: Test CLI - Python ${{ matrix.python-version }}
runs-on: ${{ (inputs['runs-on'] && startsWith(format('{0}', inputs['runs-on']), '[') && fromJSON(inputs['runs-on'])) || inputs['runs-on'] || github.event.inputs['runs-on'] || 'ubuntu-latest' }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ lfx_tests: ## run lfx package unit tests
@echo 'Running LFX Package Tests...'
@cd src/lfx && \
uv sync && \
uv run pytest tests/unit -v $(args)
uv run pytest tests/unit -v --cov=src/lfx --cov-report=xml --cov-report=html --cov-report=term-missing $(args)

integration_tests:
uv run pytest src/backend/tests/integration \
Expand Down
22 changes: 20 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ coverage:
flags:
- frontend

# LFX coverage: Target for core package (excludes components)
# Components (third-party integrations) tracked separately
# Current core coverage: ~44%, Target: 60% (aspirational improvement)
lfx:
target: 60%
# Threshold: Allowable drop in coverage before failing the check
# 5% = coverage can drop from 44% to 39% without failing status
threshold: 5%
flags:
- lfx

# New code coverage requirements - realistic target for current state
# Encourages testing new features without blocking development
patch:
Expand All @@ -51,7 +62,7 @@ comment:
require_base: false # Don't require base branch comparison
require_head: true # Require current branch coverage

# Define separate coverage tracking for frontend and backend
# Define separate coverage tracking for frontend, backend, and lfx
flags:
backend:
paths:
Expand All @@ -61,6 +72,10 @@ flags:
paths:
- src/frontend/
carryforward: true # Preserve coverage data across builds if missing
lfx:
paths:
- src/lfx/
carryforward: true # Preserve coverage data across builds if missing

# Define coverage components for granular reporting
component_management:
Expand All @@ -86,6 +101,7 @@ ignore:
- "src/backend/tests/**"
- "src/frontend/tests/**"
- "src/frontend/test-results/**"
- "src/lfx/tests/**"
# Build artifacts and dependencies
- "**/__pycache__/**"
- "**/*.pyc"
Expand All @@ -94,4 +110,6 @@ ignore:
# Python package init files - typically just imports
- "**/__init__.py"
# Database migrations
- "**/migrations/**"
- "**/migrations/**"
# LFX components - third-party integrations tracked separately
- "src/lfx/components/**"
20 changes: 20 additions & 0 deletions src/lfx/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,25 @@ dev = [
"hypothesis>=6.136.3",
"pytest>=8.4.1",
"pytest-asyncio>=0.26.0",
"pytest-cov>=7.0.0",
"ruff>=0.9.10",
]

[tool.coverage.run]
branch = true
omit = [
"*/tests/*",
"*/__init__.py",
"*/components/*", # Third-party integrations tracked separately
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == '__main__':",
"if TYPE_CHECKING:",
"@abstractmethod",
]
34 changes: 18 additions & 16 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading