Repository navigation
feat: add integration tests for Langflow agent (RHAIENG-4033) #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4dc96aa
feat: add integration tests for Langflow Simple Tool Calling Agent (R…
mpk-droid f602a43
fix: use /health_check endpoint and shared health_check() utility
mpk-droid 3eefbbf
fix: use module import to avoid ruff F811 redefinition
mpk-droid 76b4ac6
merge: resolve conflict with a2a agent matrix entry from main
mpk-droid e1db125
fix: address PR review comments (#243)
mpk-droid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
agents/langflow/templates/simple_tool_calling_agent/tests/integration/conftest.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import logging | ||
|
|
||
| import pytest | ||
| from integration.conftest import cluster_auth, repo_root # noqa: F401 | ||
| from integration.utils import ( | ||
| RouteNotFoundError, | ||
| get_route, | ||
| load_agent_name, | ||
| resolve_agent_dir, | ||
| ) | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| @pytest.fixture(scope="module") | ||
| def agent_dir(): | ||
| return resolve_agent_dir(__file__) | ||
|
|
||
|
|
||
| @pytest.fixture(scope="module") | ||
| def agent_name(agent_dir): | ||
| return load_agent_name(agent_dir) | ||
|
|
||
|
|
||
| @pytest.fixture(scope="module") | ||
| def deployed_agent(cluster_auth, agent_name): # noqa: F811 | ||
| namespace = cluster_auth["namespace"] | ||
| try: | ||
| route_url = get_route(agent_name, namespace=namespace) | ||
| except RouteNotFoundError as exc: | ||
| pytest.fail( | ||
| f"Pre-deployed agent route not found: {exc}. " | ||
| "Ensure the agent is deployed before running integration tests." | ||
| ) | ||
| logger.info("Pre-deployed agent at %s", route_url) | ||
| yield route_url |
10 changes: 10 additions & 0 deletions
10
agents/langflow/templates/simple_tool_calling_agent/tests/integration/test_deployment.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import pytest | ||
| from integration.utils import health_check | ||
|
|
||
|
|
||
| @pytest.mark.integration | ||
| def test_health_endpoint(deployed_agent): | ||
| result = health_check(f"{deployed_agent}/health_check", retries=12, backoff=5.0) | ||
| assert result["status"] == "ok" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Document the actual readiness endpoint
This bullet should explicitly say
GET /health_check, not just “pre-deployed health check”. The surrounding guidance definesGET /healthas the standard contract, so the current wording is ambiguous and can send contributors to the wrong endpoint.As per coding guidelines, agent-specific layout and workflow documentation should accurately describe this non-standard agent.
🤖 Prompt for AI Agents
Source: Coding guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e1db125 — updated the langflow entry to reflect
tests/integration/and thetest-integrationMakefile target.Assisted by Claude Opus 4.6 (1M context)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mpk-droidThanks for the update! Looking at the current wording — "Hastests/integration/(pre-deployed health check only)" — it still doesn't explicitly name theGET /health_checkendpoint, which was the core ask (to avoid ambiguity with the standardGET /healthcontract mentioned elsewhere in the doc). If that's an intentional simplification, that's fine, but if you'd like it fully explicit, something like:would remove any ambiguity for future contributors.