Skip to content

refactor(tests): parameterize template tests and update timeout use#9224

Merged
ogabrielluiz merged 7 commits into
mainfrom
refactor-template-tests
Jul 29, 2025
Merged

refactor(tests): parameterize template tests and update timeout use#9224
ogabrielluiz merged 7 commits into
mainfrom
refactor-template-tests

Conversation

@ogabrielluiz
Copy link
Copy Markdown
Contributor

@ogabrielluiz ogabrielluiz commented Jul 29, 2025

Refactored the template tests in test_starter_projects.py to utilize parameterization for better readability and maintainability. Introduced helper functions to retrieve template files and disabled tracing for all tests.

Summary by CodeRabbit

  • Refactor
    • Updated all starter project components to use the new lfx namespace instead of langflow, ensuring consistency across import paths and module references.
    • Adjusted some default values and minor method calls in a few components (such as user-agent headers and toolkit function names) to align with the new structure.
    • No changes to component logic, user-facing behavior, or public interfaces.

…asyncio.wait_for calls

Updated the validate_flow_execution function to directly use the client.post and client.get methods with a timeout parameter, improving code readability and maintainability. This change eliminates redundant timeout handling while ensuring consistent timeout values across API calls.
Refactored the template tests in `test_starter_projects.py` to utilize parameterization for better readability and maintainability. Introduced helper functions to retrieve template files and disabled tracing for all tests. Updated individual test methods to validate JSON structure, flow execution, and endpoint validation, ensuring comprehensive coverage of template functionality. This change streamlines the testing process and enhances the robustness of the test suite.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 29, 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

This change systematically updates the import paths, module metadata, and code hashes in multiple JSON starter project files, migrating all references from the langflow namespace to the lfx namespace. Minor adjustments include changes to default values, method calls, and utility function usage, but no core logic or control flow is altered.

Changes

Cohort / File(s) Change Summary
Namespace migration: Basic Prompt Chaining
src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json
Updated all component import paths and code hashes from langflow to lfx namespace; no logic changes.
Namespace migration: Basic Prompting
src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json
Changed all import statements and module metadata from langflow to lfx; logic and signatures unchanged.
Namespace migration: Blog Writer
src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json
Updated all component imports from langflow to lfx; changed user-agent header source in URLComponent; logic unchanged.
Namespace migration: Custom Component Generator
src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json
Replaced all import paths and module metadata from langflow to lfx; no logic or signature changes.
Namespace migration: Document Q&A
src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json
Changed all import paths and module references from langflow to lfx; updated base inputs retrieval in FileComponent; logic unchanged.
Namespace migration: Financial Report Parser
src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json
Updated all imports and module metadata from langflow to lfx; no logic or signature changes.
Namespace migration: Image Sentiment Analysis
src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json
Changed all import paths and module metadata from langflow to lfx; logic and signatures unchanged.
Namespace migration: Invoice Summarizer
src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json
Updated all import paths and module metadata from langflow to lfx; minor import adjustments in AgentComponent; logic unchanged.
Namespace migration: Memory Chatbot
src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
Changed all import paths and module metadata from langflow to lfx; logic and signatures unchanged.
Namespace migration: News Aggregator
src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json
Updated all import paths and module metadata from langflow to lfx; minor import order and toolkit function changes; logic unchanged.
Namespace migration: Pokédex Agent
src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json
Changed all import paths and module metadata from langflow to lfx; minor adjustments to default values and toolkit function usage; logic unchanged.
Namespace migration: Portfolio Website Code Generator
src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json
Updated all import paths and module metadata from langflow to lfx; updated base inputs retrieval in FileComponent; logic unchanged.
Namespace migration: Price Deal Finder
src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json
Changed all import paths and module metadata from langflow to lfx; minor utility function and import adjustments in AgentComponent; logic unchanged.
Namespace migration: Research Agent
src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json
Updated all import paths and module metadata from langflow to lfx; toolkit function alias change in AgentComponent; logic unchanged.
Addition: API key message file
news-aggregated.json
Added a new JSON file with a message indicating an API key is required to access job postings data.

Sequence Diagram(s)

Omitted due to the nature of the changes (namespace refactoring and metadata updates only).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

Suggested labels

refactor, size:L, lgtm

Suggested reviewers

  • edwinjosechittilappilly
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor-template-tests

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jul 29, 2025
Copy link
Copy Markdown
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: 8

🔭 Outside diff range comments (10)
src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json (3)

904-921: Stale imports inside PromptComponent.code block

The embedded code still imports from the langflow.* namespace, contradicting the rest of the migration.

-from langflow.base.prompts.api_utils import process_prompt_template
-from langflow.custom.custom_component.component import Component
-from langflow.inputs.inputs import DefaultPromptField
-from langflow.io import MessageTextInput, Output, PromptInput
-from langflow.schema.message import Message
-from langflow.template.utils import update_template_values
+from lfx.base.prompts.api_utils import process_prompt_template
+from lfx.custom.custom_component.component import Component
+from lfx.inputs.inputs import DefaultPromptField
+from lfx.io import MessageTextInput, Output, PromptInput
+from lfx.schema.message import Message
+from lfx.template.utils import update_template_values

Failing to adjust these will raise ModuleNotFoundError once the old package is gone.


880-883: Update module references to lfx namespace in all starter project JSONs

I ran a grep and found 26 leftover "module": "langflow…" entries across 17 starter project files under initial_setup/starter_projects. Each must be updated to the new lfx namespace and its code_hash regenerated:

Example diffs:

- "module": "langflow.components.prompts.prompt.PromptComponent"
+ "module": "lfx.components.prompts.prompt.PromptComponent"
- "module": "langflow.components.data.file.FileComponent"
+ "module": "lfx.components.data.file.FileComponent"

Impacted files (with first occurrence line numbers):

  • Basic Prompting.json:410
  • Twitter Thread Generator.json:1614
  • Text Sentiment Analysis.json:2305
  • Vector Store RAG.json:620
  • SaaS Pricing.json:120
  • SEO Keyword Generator.json:123, 428
  • Sequential Tasks Agents.json:1452, 1590, 1731
  • Research Agent.json:320, 779, 994, 1126
  • Memory Chatbot.json:802
  • Invoice Summarizer.json:175
  • Image Sentiment Analysis.json:882
  • Instagram Copywriter.json:619, 908, 1372
  • Meeting Summary.json:474, 1546
  • Document Q&A.json:789, 1240
  • Blog Writer.json:181
  • Custom Component Generator.json:567

You can bulk-find files with:

rg -l '"module": "langflow' src/backend/base/langflow/initial_setup/starter_projects

After updating each "module" entry, run your code-hash generator (e.g. via langflow initial_setup) to populate the new code_hash values.


1324-1340: Migrate ParserComponent imports to lfx namespace

In src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json, under the template.code.value for ParserComponent (around lines 1324–1340), update the import statements:

-from langflow.custom import Component
-from langflow.io import (
+from lfx.custom import Component
+from lfx.io import (
     BoolInput,
     HandleInput,
     MessageTextInput,
     MultilineInput,
     Output,
     TabInput,
 )
-from langflow.schema import Data, DataFrame
-from langflow.schema.message import Message
+from lfx.schema import Data, DataFrame
+from lfx.schema.message import Message

There are no module or code_hash fields for this component in the JSON, so no further metadata updates are needed.

src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (1)

1370-1410: Placeholder API keys bypass validation
The default value "OPENAI_API_KEY" (and equivalents for other providers) is truthy, so the missing-key guard is never triggered. Users will hit runtime auth failures instead of the early, explicit error you intended.

-        if provider == "OpenAI":
-            if not self.api_key:
+        if provider == "OpenAI":
+            if not self.api_key or self.api_key.strip() == "OPENAI_API_KEY":
             msg = "OpenAI API key is required when using OpenAI provider"
             raise ValueError(msg)

Repeat the same pattern for Anthropic ("ANTHROPIC_API_KEY") and Google ("GOOGLE_API_KEY") branches to ensure consistent validation.

src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json (2)

1239-1241: Inconsistent metadata – FileComponent still points to the old namespace

"module": "langflow.components.data.file.FileComponent" was missed. This breaks lazy-loading and code-preview in the UI.

-              "module": "langflow.components.data.file.FileComponent"
+              "module": "lfx.components.data.file.FileComponent"

788-790: PromptComponent metadata & embedded code still use langflow.*

  1. Metadata module path:
- "module": "langflow.components.prompts.prompt.PromptComponent"
+ "module": "lfx.components.prompts.prompt.PromptComponent"
  1. Embedded code (lines 850-851) imports:
    from langflow.* → should be from lfx.*

Please update both to avoid runtime import errors.

src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json (2)

540-620: Invalid isinstance usage with union-types → raises TypeError at runtime

isinstance(x, Message | Data | DataFrame | str) (and the similar checks below) is not allowed prior to Python 3.12 – it raises
TypeError: isinstance() arg 2 must be a type or tuple of types.
Use a tuple instead.

-        if isinstance(item, Message | Data | DataFrame | str) for item in self.input_value
+        if isinstance(item, (Message, Data, DataFrame, str)) for item in self.input_value-        if not isinstance(
-            self.input_value,
-            Message | Data | DataFrame | str | list | Generator | type(None),
-        ):
+        if not isinstance(
+            self.input_value,
+            (Message, Data, DataFrame, str, list, Generator, type(None)),
+        ):

Failing to fix this will break all flows using Chat Output.


1780-1810: Missing public helper get_component_toolkit

The new code in AgentComponent._get_tools() does:

from lfx.custom.custom_component.component import get_component_toolkitcomponent_toolkit = get_component_toolkit()

However, grep shows only a private function _get_component_toolkit() is defined and used across the repo:

• src/backend/base/langflow/custom/custom_component/component.py:61 defines _get_component_toolkit()
• Other imports in agent.py and run_flow.py all reference _get_component_toolkit

This mismatch will raise ImportError at runtime.

Please update one of the following:

  • In component.py, export the public alias:
    get_component_toolkit = _get_component_toolkit
  • Or change all imports in AgentComponent (and elsewhere) to use _get_component_toolkit.
src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json (1)

1030-1055: isinstance() used with union operators breaks at runtime

Inside ChatOutput._validate_input the following pattern is repeated:

isinstance(item, Message | Data | DataFrame | str)

and later

isinstance(self.input_value, Message | Data | DataFrame | str | list | Generator | type(None))

isinstance does not accept the PEP-604 | union syntax – it raises
TypeError: isinstance() argument 2 cannot be a union. Replace the union with a tuple of types:

- isinstance(item, Message | Data | DataFrame | str)
+ isinstance(item, (Message, Data, DataFrame, str))

- isinstance(
-     self.input_value,
-     Message | Data | DataFrame | str | list | Generator | type(None),
- )
+ isinstance(
+     self.input_value,
+     (Message, Data, DataFrame, str, list, Generator, type(None)),
+ )

This is a hard-error that prevents the component from working.

src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json (1)

520-600: Fix invalid use of PEP-604 unions in isinstance

ChatOutput._validate_input() calls

isinstance(item, Message | Data | DataFrame | str)
...
isinstance(self.input_value, Message | Data | DataFrame | str | list | Generator | type(None))

isinstance / issubclass cannot receive a PEP-604 union; passing one raises
TypeError: isinstance() argument 2 cannot be a union.

- if isinstance(item, Message | Data | DataFrame | str)
+ if isinstance(item, (Message, Data, DataFrame, str))

- if not isinstance(
-     self.input_value,
-     Message | Data | DataFrame | str | list | Generator | type(None),
- ):
+ if not isinstance(
+     self.input_value,
+     (Message, Data, DataFrame, str, list, Generator, type(None)),
+ ):

Without this fix, every execution path that reaches these checks will crash, breaking the whole starter project.

🧹 Nitpick comments (15)
src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json (1)

258-258: Left-over langflow references?

Imports inside the code block have been switched to lfx.*, 👍.
Make sure no stray langflow. names remain in this snippet (or any other snippet in the file); otherwise the template crashes when executed.

Consider adding an alias layer (lfx.__init__: import importlib, sys; sys.modules["langflow"]=importlib.import_module("lfx")) during the transition to avoid breaking existing user flows.

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json (3)

430-447: Docs URL still references the old langflow site – update or drop.

All imports have been migrated to lfx.*, but the documentation string inside the code still says
"https://docs.langflow.org/components-io#chat-input".
Either move the docs or point to the new location to avoid dead links.

-    documentation: str = "https://docs.langflow.org/components-io#chat-input"
+    # TODO: update once the new docs domain is live
+    documentation: str = "https://docs.lfx.ai/components-io#chat-input"

767-768: Minor: _validate_input accepts a Generator but convert_to_string passes it through unchanged.

Down-stream components must be ready to handle a generator of unknown length.
If not, consider eagerly consuming or at least documenting the behaviour.


1311-1312: Three copies of LanguageModelComponent are identical – prefer a shared template.

Keeping identical code blobs in every starter flow is a maintenance burden; a single source of truth (importing the component class from lfx) avoids silent drift.

src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json (1)

561-562: Code block migrated to lfx – docs URL now misleading

The component code now lives under the lfx package, but its documentation string still points to docs.langflow.org. Update the URL (or add a redirect) to prevent broken “open in docs” links.

-    documentation: str = "https://docs.langflow.org/components-io#chat-input"
+    documentation: str = "https://docs.langflow.org/components-io#chat-input"  # TODO: update once lfx docs domain is live
src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json (2)

1339-1339: Minor design quirk in FileComponent : _base_inputs shadowing

_base_inputs = deepcopy(BaseFileComponent.get_base_inputs())

Defining a class variable with the same name as an attribute used in the base class can be confusing, and it permanently detaches the list from future upstream additions. Prefer a local temp variable (e.g. _inputs) and keep the final inputs = [...] source-of-truth, or call get_base_inputs() directly inside the list literal:

- _base_inputs = deepcopy(BaseFileComponent.get_base_inputs())
- for input_item in _base_inputs:
+ _inputs = deepcopy(BaseFileComponent.get_base_inputs())
+ for input_item in _inputs:
     ...
- inputs = [*_base_inputs, BoolInput(...), IntInput(...)]
+ inputs = [*_inputs, BoolInput(...), IntInput(...)]

Not critical, but improves clarity and maintainability.


1951-1951: Duplicate LanguageModel component string

Same observation as above for the second LanguageModel node. If both strings are identical, consider deduplicating to avoid drift.

src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (1)

560-620: convert_to_string discards the clean_data flag for single inputs
When the input is not a list/Generator, the helper is invoked without the clean_data argument, leading to asymmetric behaviour.

-        return safe_convert(self.input_value)
+        return safe_convert(self.input_value, clean_data=self.clean_data)

This keeps the output consistent with the list-handling branch.

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json (1)

186-202: Embedded code still references docs.langflow.org – branding drift

The snippet has been switched to lfx.* imports but the documentation URL inside the class still points to https://docs.langflow.org/....
If the project is re-branding under the lfx namespace, you may want to update the link to avoid confusing users.

src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json (1)

545-547: Optional: tighten the input-validation branch in ChatOutput

When self.input_value is a Generator, the method returns the generator directly. Down-stream components often expect a plain str; consider eagerly consuming / joining the generator here (or documenting that a generator can propagate).

src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json (1)

820-870: Redundant / conflicting keys in payload construction

days and time_range are populated twice – first unconditionally, then conditionally.
This means:

  1. You always send "days": self.days even when the topic is not "news".
  2. The second assignment silently overwrites the first, adding cognitive overhead.

Consider building the dict only once, adding keys conditionally:

-            "days": self.days,
-            "time_range": self.time_range,
+            # optional parameters are appended below

and remove the unconditional entries.
This keeps the request body minimal and easier to reason about.

src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json (2)

1211-1213: Mixed langflow / lfx imports inside SaveToFileComponent

Although the component itself moved to lfx.components.processing.save_file.SaveToFileComponent, its code block still imports several services from the langflow namespace:

from langflow.api.v2.files import upload_user_file
from langflow.services.auth.utils import create_user_longterm_token
from langflow.services.database.models.user.crud import get_user_by_id

If the intention is a complete namespace migration, these cross-package references will re-introduce the old dependency chain. Either:

  1. Keep the component under the langflow package until all helpers are available under lfx, or
  2. Expose equivalent helpers inside lfx and update the imports accordingly.

Otherwise this starter will raise ModuleNotFoundError when used from a pure-lfx environment.


268-286: Header still advertises langflow instead of lfx

In AgentQL.build_output the request header sets

"X-TF-Request-Origin": "langflow",

Consider updating this literal (or making it a constant) so analytics correctly reflect the new branding / package name.

src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json (2)

928-945: Align default timeout between code and template

The IntInput defined inside the embedded APIRequestComponent code sets value=30, but the surrounding JSON template below defines:

"timeout": {
  ...
  "value": 5
}

This mismatch makes the initial UI value (5 s) diverge from the component-internal default (30 s). Pick one constant to avoid confusing users and tests.


915-925: Hard-coding User-Agent string loses version context

headers default is now:

value=[{"key": "User-Agent", "value": "Langflow/1.0"}]

Consider deriving the value from an actual package __version__ (or dropping it) so downstream analytics/debugging can differentiate Langflow versions.

Example:

- {"key": "User-Agent", "value": "Langflow/1.0"}
+ {"key": "User-Agent", "value": f"Langflow/{lfx.__version__}"}

Comment thread src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json Outdated
Comment thread src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json Outdated
Comment thread src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json Outdated
Comment thread src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json Outdated
Comment thread src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json Outdated
… JSON files

Modified the metadata section in multiple starter project JSON files to reflect updated code hashes and module paths, transitioning from 'lfx' to 'langflow' components. This change enhances consistency across the codebase and ensures that the correct modules are referenced for improved maintainability and clarity.
Modified the commands in the Makefile and CI workflows to include the `-n auto` option for pytest, enabling parallel test execution for the starter project template tests. This change enhances test performance and efficiency across the codebase.
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jul 29, 2025
Deleted the news-aggregated.json file
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jul 29, 2025
@ogabrielluiz ogabrielluiz added the lgtm This PR has been approved by a maintainer label Jul 29, 2025
@ogabrielluiz ogabrielluiz enabled auto-merge July 29, 2025 13:11
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.72%. Comparing base (629a6d2) to head (ca16104).
⚠️ Report is 7 commits behind head on main.

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

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #9224      +/-   ##
==========================================
- Coverage   52.72%   52.72%   -0.01%     
==========================================
  Files         634      634              
  Lines       43605    43605              
  Branches      125      125              
==========================================
- Hits        22992    22991       -1     
- Misses      20563    20564       +1     
  Partials       50       50              
Flag Coverage Δ
backend 52.56% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...backend/base/langflow/utils/template_validation.py 96.96% <100.00%> (ø)

... and 3 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.

Copy link
Copy Markdown
Contributor

@Yukiyukiyeah Yukiyukiyeah left a comment

Choose a reason for hiding this comment

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

Thank you very much for the refactor! I learned a lot

@SonicDMG SonicDMG temporarily deployed to refactor-template-tests - langflow-manual-install PR #9224 July 29, 2025 18:54 — with Render Destroyed
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jul 29, 2025
@SonicDMG SonicDMG temporarily deployed to refactor-template-tests - langflow-manual-install PR #9224 July 29, 2025 18:55 — with Render Destroyed
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jul 29, 2025
@sonarqubecloud
Copy link
Copy Markdown

@ogabrielluiz ogabrielluiz added this pull request to the merge queue Jul 29, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jul 29, 2025
@ogabrielluiz ogabrielluiz added this pull request to the merge queue Jul 29, 2025
Merged via the queue into main with commit cd4464d Jul 29, 2025
131 of 134 checks passed
@ogabrielluiz ogabrielluiz deleted the refactor-template-tests branch July 29, 2025 22:51
2getsandesh pushed a commit to 2getsandesh/langflow-IBM that referenced this pull request Aug 6, 2025
…angflow-ai#9224)

* refactor: Simplify flow execution validation by removing unnecessary asyncio.wait_for calls

Updated the validate_flow_execution function to directly use the client.post and client.get methods with a timeout parameter, improving code readability and maintainability. This change eliminates redundant timeout handling while ensuring consistent timeout values across API calls.

* refactor: Enhance template tests for improved structure and validation

Refactored the template tests in `test_starter_projects.py` to utilize parameterization for better readability and maintainability. Introduced helper functions to retrieve template files and disabled tracing for all tests. Updated individual test methods to validate JSON structure, flow execution, and endpoint validation, ensuring comprehensive coverage of template functionality. This change streamlines the testing process and enhances the robustness of the test suite.

* refactor: Update project metadata and import paths in starter project JSON files

Modified the metadata section in multiple starter project JSON files to reflect updated code hashes and module paths, transitioning from 'lfx' to 'langflow' components. This change enhances consistency across the codebase and ensures that the correct modules are referenced for improved maintainability and clarity.

* chore: Update template test commands to utilize parallel execution

Modified the commands in the Makefile and CI workflows to include the `-n auto` option for pytest, enabling parallel test execution for the starter project template tests. This change enhances test performance and efficiency across the codebase.

* chore: Remove  news-aggregated.json file

Deleted the news-aggregated.json file

* Update test_template_validation.py

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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 refactor Maintenance tasks and housekeeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants