Files
flow/scripts/generate_coverage_config.md
T
zeekay d650dd60f0 refactor(rebrand): langflow->flow across docs, starter-project data, CI, tests
Docs corpus (Langflow->Hanzo Flow, upstream URLs langflow-ai/langflow->hanzoai/
flow, docs.langflow.org->docs.hanzo.ai), starter-project template help-URLs, CI
workflows, and test files. Remaining 'langflow' repo-wide is now dominated by
LANGFLOW_* env-var names + langflow_ settings fields — the config-boundary layer
deliberately preserved pending a coordinated FLOW_/HANZO_ alias-with-fallback
(renaming them blind breaks every deployment).
2026-07-16 10:00:51 -07:00

1.4 KiB

Dynamic Coverage Configuration

This script generates a custom .coveragerc file for backend testing that excludes:

  1. Bundled components - Components listed in SIDEBAR_BUNDLES from src/frontend/src/utils/styleUtils.ts
  2. Legacy components - Python files containing legacy = True

How it works

  1. Reads frontend config: Parses styleUtils.ts to extract bundled component names
  2. Scans backend files: Finds all .py files in src/backend/base/flow/components/ with legacy = True
  3. Generates .coveragerc: Creates exclusion patterns for pytest-cov

Usage

Local development

# Generate config and run tests
python3 scripts/generate_coverage_config.py
cd src/backend && python -m pytest --cov=src/backend/base/flow --cov-config=.coveragerc

CI Integration

The script runs automatically in CI before backend tests via .github/workflows/python_test.yml.

Files affected

  • Input: src/frontend/src/utils/styleUtils.ts (SIDEBAR_BUNDLES)
  • Input: src/backend/base/flow/components/**/*.py (legacy components)
  • Output: src/backend/.coveragerc (auto-generated, in .gitignore)

Benefits

  • Accurate coverage: Focuses on actively maintained core code
  • Dynamic updates: Automatically adapts when bundles/legacy components change
  • Codecov compatible: Generated config works with both local testing and Codecov reporting