test(langchain): add real HTTP server support for agent invoke tests#51
Open
test(langchain): add real HTTP server support for agent invoke tests#51
Conversation
Add _start_server function to launch actual FastAPI servers for integration testing, modify request functions to accept both app objects and server URLs, and update test fixtures to use real HTTP connections instead of ASGI transport. This enables more realistic testing of agent invoke methods using actual HTTP requests while maintaining backward compatibility with ASGI transport for non-streaming tests. The changes affect test_agent_invoke_methods.py with new server startup logic, enhanced request handling, and proper server cleanup in test fixtures. test(langchain): 为代理调用测试添加真实 HTTP 服务器支持 添加 _start_server 函数以启动实际的 FastAPI 服务器进行集成测试, 修改请求函数以接受 app 对象和服务器 URL, 并更新测试 fixture 以使用真实的 HTTP 连接而不是 ASGI 传输。 这使得使用实际 HTTP 请求对代理调用方法进行更真实的测试 同时保持与 ASGI 传输的向后兼容性以用于非流式测试。 这些更改影响 test_agent_invoke_methods.py 中的新服务器启动逻辑、 增强的请求处理和测试 fixture 中的适当服务器清理。 Change-Id: Icb5b09c2d588021cf72749658b1d07237fc1ef9c Signed-off-by: OhYee <oyohyee@oyohyee.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add _start_server function to launch actual FastAPI servers for integration testing, modify request functions to accept both app objects and server URLs, and update test fixtures to use real HTTP connections instead of ASGI transport.
This enables more realistic testing of agent invoke methods using actual HTTP requests while maintaining backward compatibility with ASGI transport for non-streaming tests.
The changes affect test_agent_invoke_methods.py with new server startup logic, enhanced request handling, and proper server cleanup in test fixtures.
test(langchain): 为代理调用测试添加真实 HTTP 服务器支持
添加 _start_server 函数以启动实际的 FastAPI 服务器进行集成测试,
修改请求函数以接受 app 对象和服务器 URL,
并更新测试 fixture 以使用真实的 HTTP 连接而不是 ASGI 传输。
这使得使用实际 HTTP 请求对代理调用方法进行更真实的测试
同时保持与 ASGI 传输的向后兼容性以用于非流式测试。
这些更改影响 test_agent_invoke_methods.py 中的新服务器启动逻辑、
增强的请求处理和测试 fixture 中的适当服务器清理。
Change-Id: Icb5b09c2d588021cf72749658b1d07237fc1ef9c
Fix bugs
Bug detail
Pull request tasks
Update docs
Reason for update
Pull request tasks
Add contributor
Contributed content
Content detail
Others
Reason for update