Add test suite for Bedrock boto_client_config fix (PR#11)#22
Open
jsamuel1 wants to merge 1 commit intostrands-agents:mainfrom
Open
Add test suite for Bedrock boto_client_config fix (PR#11)#22jsamuel1 wants to merge 1 commit intostrands-agents:mainfrom
jsamuel1 wants to merge 1 commit intostrands-agents:mainfrom
Conversation
- Add 20 tests covering dict->BotocoreConfig conversion (ref strands-agents#11) - Test backward compatibility with existing BotocoreConfig objects - Validate JSON config parsing scenarios that were failing - Include regression prevention tests - Demonstrate original AttributeError and verify fix prevents it - Cover edge cases: None values, empty dicts, complex configurations - Organize tests in logical classes for maintainability Fixes the testing gap for the critical Bedrock configuration bug that prevented users from launching Strands with JSON-parsed configs.
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.
Overview
This PR adds a comprehensive test suite for the critical Bedrock configuration fix implemented in PR #11. The original issue caused
AttributeError: 'dict' object has no attribute 'merge'when launching Strands agents with JSON-parsed Bedrock configurations.Problem Statement
PR #11 fixed the bug where
boto_client_configparameters from JSON configuration files were passed as plain dictionaries instead ofBotocoreConfigobjects, causing runtime errors. However, this critical fix lacked comprehensive test coverage to:Solution
This PR adds 20 comprehensive tests organized in 4 logical test classes:
🧪 Test Coverage
1.
TestBedrockInstance(10 tests)2.
TestBedrockConfigConversion(4 tests)3.
TestBedrockIntegrationScenarios(3 tests)4.
TestRegressionPrevention(3 tests)Key Test Scenarios
✅ Main Fix Verification
✅ JSON Configuration Scenario
✅ Error Demonstration
Changes Made
Files Added
tests/test_models_bedrock.py- Complete test suite (590 lines, 20 tests)Test Quality Features
Test Results
Benefits
Relationship to PR #11
This PR directly supports PR #11 by:
Testing Instructions
Backwards Compatibility
✅ No breaking changes - This PR only adds tests
✅ No production impact - Tests run in isolation with mocking
✅ Fast execution - All 20 tests complete in 0.05 seconds
Closes: Testing gap for PR #11
References: #11 (Bedrock boto_client_config fix)
Type: Test Enhancement
Risk: Low (test-only changes)