test: update CircuitBreakerState to use .variable#228
Conversation
Updates test_error_recovery.py and test_health_monitoring.py to align with the BaseEnum interface by using `.variable` on CircuitBreakerState enum entries instead of `.value` or string literals. Also removed the `# FIX:` comments regarding this change. Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideStandardizes tests to use CircuitBreakerState..variable instead of .value or string literals when setting circuit_breaker_state, aligning with the BaseEnum interface and removing FIX comments in health monitoring tests. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Pull request overview
This PR updates integration tests to use CircuitBreakerState.<STATE>.variable consistently (instead of .value or hard-coded strings) when setting circuit breaker state in provider mocks.
Changes:
- Replace string literals assigned to
circuit_breaker_state.variablewithCircuitBreakerState.<STATE>.variablein health monitoring tests. - Replace
.valueusages with.variablein error recovery tests to align with theBaseEnuminterface.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/integration/server/test_health_monitoring.py | Imports CircuitBreakerState and uses its .variable when configuring mocked provider circuit breaker state. |
| tests/integration/server/test_error_recovery.py | Switches mock provider circuit_breaker_state assignments from .value to .variable for consistency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| embedding_instance.circuit_breaker_state.variable = CircuitBreakerState.HALF_OPEN.variable | ||
|
|
||
| response2 = await health_service.get_health_response() | ||
| assert response2.services.embedding_provider.circuit_breaker_state == "half_open" |
| embedding_instance.circuit_breaker_state.variable = CircuitBreakerState.OPEN.variable | ||
|
|
||
| response3 = await health_service.get_health_response() | ||
| assert response3.services.embedding_provider.circuit_breaker_state == "open" |
Updates test_error_recovery.py and test_health_monitoring.py to align with the BaseEnum interface by using `.variable` on CircuitBreakerState enum entries instead of `.value` or string literals. Also removed the `# FIX:` comments regarding this change. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Fixes
# FIX:comments intests/integration/server/test_health_monitoring.pyby replacing.valueor plain string literals assigned tocircuit_breaker_state.variablewith the properCircuitBreakerState.<STATE>.variableenum properties.Also updates
tests/integration/server/test_error_recovery.pyto use.variableinstead of.valuefor consistency with theBaseEnuminterface.PR created automatically by Jules for task 6088664127128084659 started by @bashandbone
Summary by Sourcery
Align circuit breaker state handling in tests with the CircuitBreakerState enum’s variable-based interface.
Bug Fixes:
Enhancements:
Tests: