-
Notifications
You must be signed in to change notification settings - Fork 112
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
test(ci): make test suites v3 ready #1063
Conversation
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.
Disclaimer: Experimental PR review
PR Summary
This PR updates the test suite for v3 compatibility by implementing retry logic for HTTP requests, transitioning to queue-based ingestion, and modifying test metadata structures.
- Added new
HTTPClientWithRetries
class intests/utils.py
with exponential backoff (4 retries within 3s) for non-500 errors - Updated CI environment variables in
.github/workflows/ci.yml
to support queue-based ingestion with configurable delays - Changed mock metadata in
tests/test_decorators.py
from strings to dictionaries for more realistic testing scenarios - Removed direct database access environment variables from CI workflow in favor of queue-based processing
3 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
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.
Disclaimer: Experimental PR review
PR Summary
(updates since last review)
Based on the recent changes not covered in the previous review, here's a focused summary of the additional modifications:
Updates test suites for v3 API compatibility with significant changes to test infrastructure and timing handling.
- Replaced
HTTPClientWithRetries
with simplesleep(1)
delays in API calls to handle race conditions more consistently - Updated test assertions to expect empty dict ({}) instead of None for metadata across test files
- Migrated imports to use new langchain package structure (e.g.
langchain_openai
instead oflangchain_community
) - Added parallel test execution support with pytest
-n auto
flag in CI workflow - Added new test cases for multimodal inputs and structured outputs in OpenAI integration tests
The changes focus on test reliability and v3 API compatibility while simplifying the HTTP request handling approach.
10 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
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.
Disclaimer: Experimental PR review
PR Summary
(updates since last review)
Based on the recent changes not covered in previous reviews, here's a focused summary of the modifications:
Increased API call delay timing in test utilities to improve test stability and reliability.
- Increased sleep duration from 1s to 1.5s in
tests/utils.py
get_api() function to better handle race conditions - No other significant changes found since last review
The change is minimal but important for test reliability, allowing more time for API operations to complete before subsequent test assertions.
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
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.
Disclaimer: Experimental PR review
PR Summary
(updates since last review)
Based on the recent changes not covered in previous reviews, here's a focused summary of the modifications:
Refactored langchain callback handler to improve model name parsing and error handling.
- Added new
_parse_model_and_log_errors
method inlangfuse/callback/langchain.py
to centralize model name parsing logic and error reporting - Added warning message rate limiting for model parse errors to avoid log spam
- Enhanced model parameter extraction for IBM watsonx.ai integration
- Improved documentation for
get_langchain_run_name
method with clearer prioritization rules - Reordered imports for better code organization and readability
The changes focus on improving error handling and maintainability of the langchain integration while adding support for additional model providers.
10 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
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.
Disclaimer: Experimental PR review
PR Summary
(updates since last review)
Based on the recent changes not covered in previous reviews, here's a focused summary of the modifications:
Further increased API call delay timing in test utilities to improve test stability and reliability.
- Increased sleep duration from 1.5s to 2s in
tests/utils.py
get_api() function to ensure API operations complete before test assertions - This is the only significant change since the last review, continuing the focus on test stability improvements
The change is minimal but builds on previous timing adjustments to further enhance test reliability by allowing more time for API operations to settle.
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
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.
Disclaimer: Experimental PR review
PR Summary
(updates since last review)
Based on the recent changes not covered in previous reviews, here's a focused summary of the modifications:
Updated test assertions and metadata handling in core SDK tests to align with v3 API expectations.
- Modified metadata assertions in
tests/test_core_sdk.py
to expect integer values instead of strings for count fields - Updated categorical score tests to expect default value of 0 instead of None for numeric scores
- Added timezone awareness tests to ensure proper UTC handling in observation timestamps
- Removed debug=False flags from several test cases as they are no longer needed in v3
The changes focus on data type consistency and proper timestamp handling to ensure compatibility with the v3 API specification.
3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
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.
Disclaimer: Experimental PR review
PR Summary
(updates since last review)
Based on the recent changes not covered in previous reviews, here's a focused summary of the modifications:
Updated test suites to handle langchain v3 compatibility and improved test reliability.
- Added multimodal test case in
tests/test_langchain.py
to verify ChatOpenAI model's handling of image inputs - Updated
test_callback_generated_from_trace_chain
to handle potential None values in outputs - Added
test_langfuse_overhead
to measure and verify acceptable performance impact - Refactored
test_link_langfuse_prompts_invoke
to include null checks for outputs - Added new environment variables
LANGFUSE_INGESTION_QUEUE_DELAY_MS
andLANGFUSE_INGESTION_CLICKHOUSE_WRITE_INTERVAL_MS
in CI workflow
The changes focus on expanding test coverage while ensuring compatibility with langchain v3's updated API structure.
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
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.
Disclaimer: Experimental PR review
PR Summary
(updates since last review)
Based on the recent changes not covered in previous reviews, here's a focused summary of the modifications to test_langchain.py:
Updated test assertions and error handling for improved compatibility with LangChain v3 and better test reliability.
- Added explicit parentheses in conditional expressions to fix operator precedence issues in output assertions
- Updated test cases to handle new usage details format with proper null checks and type validation
- Added test coverage for multimodal inputs in ChatOpenAI model interactions
- Improved test cleanup and resource handling with proper teardown procedures
- Added performance validation with new
test_langfuse_overhead
to ensure acceptable tracing impact
The changes focus on making tests more robust while maintaining compatibility with LangChain's updated API structure.
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
Important
Update CI and test suite for version 3 compatibility, including workflow changes, environment variables, and test adjustments.
.github/workflows/ci.yml
to include new environment variablesLANGFUSE_INGESTION_QUEUE_DELAY_MS
andLANGFUSE_INGESTION_CLICKHOUSE_WRITE_INTERVAL_MS
.pytest
command to run tests in parallel using-n auto
.langchain.py
for better organization._parse_usage_model()
inlangchain.py
to skip OpenAI usage types handled server-side.sleep(1)
inapi_wrapper.py
andtest_core_sdk.py
to ensure data consistency.test_core_sdk.py
to reflect updated metadata and usage details.api
variable in multiple test files and replace with directget_api()
calls.This description was created by for 1671e3d. It will automatically update as commits are pushed.