mirror of
https://github.com/hanzoai/flow.git
synced 2026-10-17 01:29:18 +00:00
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).
1.4 KiB
1.4 KiB
Dynamic Coverage Configuration
This script generates a custom .coveragerc file for backend testing that excludes:
- Bundled components - Components listed in
SIDEBAR_BUNDLESfromsrc/frontend/src/utils/styleUtils.ts - Legacy components - Python files containing
legacy = True
How it works
- Reads frontend config: Parses
styleUtils.tsto extract bundled component names - Scans backend files: Finds all
.pyfiles insrc/backend/base/flow/components/withlegacy = True - 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