Skip to content

Conversation

@ogabrielluiz
Copy link
Contributor

@ogabrielluiz ogabrielluiz commented Oct 14, 2025

Add lfx coverage reporting

Summary by CodeRabbit

  • Tests
    • Added coverage reporting for LFX tests, generating XML, HTML, and terminal summaries for clearer insights.
  • Chores
    • Automatically uploads LFX coverage to Codecov with a dedicated flag and stores coverage artifacts for 30 days.
    • Introduced an LFX coverage component in Codecov with defined targets and thresholds, aligning with existing components.
    • Added test coverage tooling and configuration to standardize omissions and exclusions, improving consistency across reports.

…rting

- Refined dependency markers for several packages to improve compatibility with Python 3.12 and specific platforms.
- Added pytest-cov to development dependencies for enhanced test coverage reporting.
- Updated dependencies for pyobjc frameworks to include platform-specific markers for better compatibility.
- Updated the lfx_tests target in the Makefile to include coverage reporting options for pytest.
- Added coverage metrics output in XML, HTML, and terminal formats to improve test visibility and analysis.
- Added LFX coverage target and threshold to the codecov.yml file.
- Defined separate coverage flags for frontend, backend, and LFX components.
- Updated ignore patterns to exclude LFX test and component directories from coverage reports.
- Implemented steps to upload coverage reports to Codecov for Python 3.10.
- Added artifact upload for coverage reports, retaining them for 30 days.
- Increased the LFX coverage target from 40% to 60% to encourage aspirational improvement.
- Clarified the allowable drop in coverage threshold from 44% to 39% without failing the status check.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds LFX-specific test coverage generation and reporting: pytest now produces XML/HTML coverage for src/lfx; GitHub Actions uploads LFX coverage to Codecov and as artifacts on Python 3.10; Codecov config gains an lfx component with targets/flags; dev deps and coverage settings added in src/lfx/pyproject.toml.

Changes

Cohort / File(s) Summary
CI workflow: LFX coverage upload
.github/workflows/python_test.yml
Adds post-test steps for lfx-tests to upload coverage to Codecov (flag: lfx, path: ./src/lfx/coverage.xml, dir: ./src/lfx/) and to upload coverage artifacts (xml and htmlcov) on Python 3.10.
Test command updates for LFX
Makefile
Enhances lfx_tests target to run pytest with coverage for src/lfx, emitting XML, HTML, and term-missing reports.
Codecov component/config
codecov.yml
Introduces an lfx component with its own target/threshold and flag, updates ignore rules for LFX paths, and keeps existing frontend/backend settings intact.
LFX dev/coverage settings
src/lfx/pyproject.toml
Adds pytest-cov to dev dependencies and defines coverage omit/exclude rules specific to LFX tests and patterns.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer
  participant GH as GitHub Actions (lfx-tests)
  participant PyTest as pytest + pytest-cov
  participant FS as Workspace (src/lfx/)
  participant CC as Codecov
  participant Art as Artifacts

  Dev->>GH: Push/PR triggers workflow
  GH->>PyTest: Run lfx_tests (pytest with coverage)
  PyTest->>FS: Generate coverage.xml & htmlcov
  Note over FS: src/lfx/coverage.xml<br/>src/lfx/htmlcov/

  GH->>CC: Upload coverage (flag=lfx, files from src/lfx/)
  GH->>Art: Upload artifacts (lfx-coverage-report)
  CC-->>GH: Acknowledge upload
  Art-->>GH: Artifact stored (retention=30d)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

enhancement, size:M, lgtm

Suggested reviewers

  • edwinjosechittilappilly
  • jordanrfrazier
  • Yukiyukiyeah

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Test Quality And Coverage ⚠️ Warning The pull request only adds configuration for coverage reporting and CI steps without introducing or updating any tests under the new LFX module. Because no tests were added or modified, there is no evidence that the LFX functionality is covered by comprehensive, behavior-validating pytest tests that follow the project’s patterns or that both success and error cases are exercised. Add or update pytest test files in src/lfx/ to cover all main LFX functionality, include both success and failure scenarios for any async or API endpoints, and ensure tests follow the existing project patterns so coverage reports reflect meaningful behavioral validation.
Excessive Mock Usage Warning ⚠️ Warning A review of the test suite shows multiple LFX unit tests with extremely high mock usage counts—specifically over thirty occurrences in test_container_utils.py and test_validation.py and over twenty in test_component_index.py—indicating that the tests rely heavily on mocks and may be obscuring the actual behavior being tested rather than exercising real interactions. Refactor overly mocked tests by replacing mocks with real or lightweight test doubles where feasible, focus on testing core logic behavior directly, and add higher-level integration tests for scenarios currently simulated purely via mocking to ensure the code’s actual interactions are validated.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Test Coverage For New Implementations ✅ Passed The pull request only adds coverage reporting configuration and CI workflow steps without introducing new application logic or components that would require additional tests, and it does not modify existing test files.
Test File Naming And Structure ✅ Passed All existing backend tests follow pytest’s default discovery patterns with test_*.py and *_test.py filenames and are organized under unit, integration, and performance directories, while frontend tests use the *.test.ts/tsx convention in clearly named tests folders and dedicated integration paths. A review of sample files shows descriptive test function names and use of fixtures for setup and teardown. Since this PR only adds coverage reporting steps and does not modify any test files, the naming, structure, and organization of tests remain compliant with the project’s conventions.
Title Check ✅ Passed The title accurately and concisely describes the primary change of adding LFX coverage generation and Codecov reporting in the CI configuration, matching the modifications across workflows, Makefile, and coverage config files.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.72%. Comparing base (c6a3bdb) to head (07be1de).
⚠️ Report is 1 commits behind head on main.

❌ Your project status has failed because the head coverage (48.68%) is below the target coverage (55.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #10266      +/-   ##
==========================================
+ Coverage   24.69%   29.72%   +5.03%     
==========================================
  Files        1116     1304     +188     
  Lines       40267    59156   +18889     
  Branches     5550     8834    +3284     
==========================================
+ Hits         9944    17586    +7642     
- Misses      30152    40753   +10601     
- Partials      171      817     +646     
Flag Coverage Δ
backend 48.68% <ø> (ø)
lfx 40.35% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 209 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai bot changed the title @coderabbitai ci,test(lfx): add coverage generation and Codecov reporting Oct 14, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
Makefile (1)

172-175: Make dev deps explicit and add branch coverage (optional).

  • Ensure pytest/pytest-cov are installed: make uv sync include dev group.
  • Consider branch coverage for better signal.
 @cd src/lfx && \
-uv sync && \
-uv run pytest tests/unit -v --cov=src/lfx --cov-report=xml --cov-report=html --cov-report=term-missing $(args)
+uv sync --group dev && \
+uv run pytest tests/unit -v --cov=src/lfx --cov-branch --cov-report=xml --cov-report=html --cov-report=term-missing $(args)

If your CI/local uv already installs dev by default, this is a no-op; making it explicit avoids drift. Please confirm uv’s default behavior in this repo.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 67dd41e and 2991aab.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .github/workflows/python_test.yml (1 hunks)
  • Makefile (1 hunks)
  • codecov.yml (5 hunks)
  • src/lfx/pyproject.toml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
{src/backend/**/*.py,tests/**/*.py,Makefile}

📄 CodeRabbit inference engine (.cursor/rules/backend_development.mdc)

{src/backend/**/*.py,tests/**/*.py,Makefile}: Run make format_backend to format Python code before linting or committing changes
Run make lint to perform linting checks on backend Python code

Files:

  • Makefile
{tests/**/*.py,Makefile}

📄 CodeRabbit inference engine (.cursor/rules/backend_development.mdc)

Run make unit_tests to execute backend unit tests

Files:

  • Makefile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Lint Backend / Run Mypy (3.11)
  • GitHub Check: Lint Backend / Run Mypy (3.10)
  • GitHub Check: Lint Backend / Run Mypy (3.13)
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
  • GitHub Check: Lint Backend / Run Mypy (3.12)
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
  • GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
  • GitHub Check: Test Starter Templates
🔇 Additional comments (5)
src/lfx/pyproject.toml (1)

128-130: pytest-cov addition LGTM.

Dev deps clearly include pytest-cov; aligns with Makefile/CI.

.github/workflows/python_test.yml (1)

171-191: LFX coverage upload wiring looks correct.

Flags/paths align with codecov.yml and Makefile outputs; scoped to py3.10 to avoid duplicates. Please confirm Codecov sees the report under src/lfx/ with the lfx flag.

codecov.yml (3)

39-49: LFX project status target/threshold make sense.

Aspirational 60% with 5% threshold is consistent with the PR goals.


65-79: LFX flag config matches workflow upload.

paths and carryforward true align with the action’s lfx flag usage.


96-115: Ignore rules for LFX are consistent.

Ignoring tests, migrations, and components mirrors local coverage omit. Good separation of “core” vs integrations.

@ogabrielluiz ogabrielluiz changed the title ci,test(lfx): add coverage generation and Codecov reporting ci(lfx): add coverage generation and Codecov reporting Oct 14, 2025
Copy link
Collaborator

@erichare erichare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions github-actions bot added the lgtm This PR has been approved by a maintainer label Oct 14, 2025
- Enabled branch coverage in the coverage run configuration.
- Fixed a typo in the main module check to ensure proper execution.
@sonarqubecloud
Copy link

@ogabrielluiz ogabrielluiz added this pull request to the merge queue Oct 14, 2025
Merged via the queue into main with commit 2a64615 Oct 14, 2025
31 of 32 checks passed
@ogabrielluiz ogabrielluiz deleted the add-lfx-cov-report branch October 14, 2025 22:11
Adam-Aghili pushed a commit that referenced this pull request Oct 15, 2025
* chore: update dependency markers and add pytest-cov for coverage reporting

- Refined dependency markers for several packages to improve compatibility with Python 3.12 and specific platforms.
- Added pytest-cov to development dependencies for enhanced test coverage reporting.
- Updated dependencies for pyobjc frameworks to include platform-specific markers for better compatibility.

* chore: enhance lfx_tests command with coverage reporting

- Updated the lfx_tests target in the Makefile to include coverage reporting options for pytest.
- Added coverage metrics output in XML, HTML, and terminal formats to improve test visibility and analysis.

* chore: update codecov configuration for LFX coverage tracking

- Added LFX coverage target and threshold to the codecov.yml file.
- Defined separate coverage flags for frontend, backend, and LFX components.
- Updated ignore patterns to exclude LFX test and component directories from coverage reports.

* chore: add coverage upload steps to Python CI workflow

- Implemented steps to upload coverage reports to Codecov for Python 3.10.
- Added artifact upload for coverage reports, retaining them for 30 days.

* chore: update LFX coverage target in codecov configuration

- Increased the LFX coverage target from 40% to 60% to encourage aspirational improvement.
- Clarified the allowable drop in coverage threshold from 44% to 39% without failing the status check.

* chore: update coverage configuration in pyproject.toml

- Enabled branch coverage in the coverage run configuration.
- Fixed a typo in the main module check to ensure proper execution.
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 12, 2025
…0266)

* chore: update dependency markers and add pytest-cov for coverage reporting

- Refined dependency markers for several packages to improve compatibility with Python 3.12 and specific platforms.
- Added pytest-cov to development dependencies for enhanced test coverage reporting.
- Updated dependencies for pyobjc frameworks to include platform-specific markers for better compatibility.

* chore: enhance lfx_tests command with coverage reporting

- Updated the lfx_tests target in the Makefile to include coverage reporting options for pytest.
- Added coverage metrics output in XML, HTML, and terminal formats to improve test visibility and analysis.

* chore: update codecov configuration for LFX coverage tracking

- Added LFX coverage target and threshold to the codecov.yml file.
- Defined separate coverage flags for frontend, backend, and LFX components.
- Updated ignore patterns to exclude LFX test and component directories from coverage reports.

* chore: add coverage upload steps to Python CI workflow

- Implemented steps to upload coverage reports to Codecov for Python 3.10.
- Added artifact upload for coverage reports, retaining them for 30 days.

* chore: update LFX coverage target in codecov configuration

- Increased the LFX coverage target from 40% to 60% to encourage aspirational improvement.
- Clarified the allowable drop in coverage threshold from 44% to 39% without failing the status check.

* chore: update coverage configuration in pyproject.toml

- Enabled branch coverage in the coverage run configuration.
- Fixed a typo in the main module check to ensure proper execution.
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 13, 2025
…0266)

* chore: update dependency markers and add pytest-cov for coverage reporting

- Refined dependency markers for several packages to improve compatibility with Python 3.12 and specific platforms.
- Added pytest-cov to development dependencies for enhanced test coverage reporting.
- Updated dependencies for pyobjc frameworks to include platform-specific markers for better compatibility.

* chore: enhance lfx_tests command with coverage reporting

- Updated the lfx_tests target in the Makefile to include coverage reporting options for pytest.
- Added coverage metrics output in XML, HTML, and terminal formats to improve test visibility and analysis.

* chore: update codecov configuration for LFX coverage tracking

- Added LFX coverage target and threshold to the codecov.yml file.
- Defined separate coverage flags for frontend, backend, and LFX components.
- Updated ignore patterns to exclude LFX test and component directories from coverage reports.

* chore: add coverage upload steps to Python CI workflow

- Implemented steps to upload coverage reports to Codecov for Python 3.10.
- Added artifact upload for coverage reports, retaining them for 30 days.

* chore: update LFX coverage target in codecov configuration

- Increased the LFX coverage target from 40% to 60% to encourage aspirational improvement.
- Clarified the allowable drop in coverage threshold from 44% to 39% without failing the status check.

* chore: update coverage configuration in pyproject.toml

- Enabled branch coverage in the coverage run configuration.
- Fixed a typo in the main module check to ensure proper execution.
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 13, 2025
…0266)

* chore: update dependency markers and add pytest-cov for coverage reporting

- Refined dependency markers for several packages to improve compatibility with Python 3.12 and specific platforms.
- Added pytest-cov to development dependencies for enhanced test coverage reporting.
- Updated dependencies for pyobjc frameworks to include platform-specific markers for better compatibility.

* chore: enhance lfx_tests command with coverage reporting

- Updated the lfx_tests target in the Makefile to include coverage reporting options for pytest.
- Added coverage metrics output in XML, HTML, and terminal formats to improve test visibility and analysis.

* chore: update codecov configuration for LFX coverage tracking

- Added LFX coverage target and threshold to the codecov.yml file.
- Defined separate coverage flags for frontend, backend, and LFX components.
- Updated ignore patterns to exclude LFX test and component directories from coverage reports.

* chore: add coverage upload steps to Python CI workflow

- Implemented steps to upload coverage reports to Codecov for Python 3.10.
- Added artifact upload for coverage reports, retaining them for 30 days.

* chore: update LFX coverage target in codecov configuration

- Increased the LFX coverage target from 40% to 60% to encourage aspirational improvement.
- Clarified the allowable drop in coverage threshold from 44% to 39% without failing the status check.

* chore: update coverage configuration in pyproject.toml

- Enabled branch coverage in the coverage run configuration.
- Fixed a typo in the main module check to ensure proper execution.
korenLazar pushed a commit to kiran-kate/langflow that referenced this pull request Nov 13, 2025
…0266)

* chore: update dependency markers and add pytest-cov for coverage reporting

- Refined dependency markers for several packages to improve compatibility with Python 3.12 and specific platforms.
- Added pytest-cov to development dependencies for enhanced test coverage reporting.
- Updated dependencies for pyobjc frameworks to include platform-specific markers for better compatibility.

* chore: enhance lfx_tests command with coverage reporting

- Updated the lfx_tests target in the Makefile to include coverage reporting options for pytest.
- Added coverage metrics output in XML, HTML, and terminal formats to improve test visibility and analysis.

* chore: update codecov configuration for LFX coverage tracking

- Added LFX coverage target and threshold to the codecov.yml file.
- Defined separate coverage flags for frontend, backend, and LFX components.
- Updated ignore patterns to exclude LFX test and component directories from coverage reports.

* chore: add coverage upload steps to Python CI workflow

- Implemented steps to upload coverage reports to Codecov for Python 3.10.
- Added artifact upload for coverage reports, retaining them for 30 days.

* chore: update LFX coverage target in codecov configuration

- Increased the LFX coverage target from 40% to 60% to encourage aspirational improvement.
- Clarified the allowable drop in coverage threshold from 44% to 39% without failing the status check.

* chore: update coverage configuration in pyproject.toml

- Enabled branch coverage in the coverage run configuration.
- Fixed a typo in the main module check to ensure proper execution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants