fix: Resolve indentation and duplicate definition errors blocking tests#211
Conversation
- Fixed indentation error in `tests/unit/engine/services/test_config_analyzer.py` on line 543 inside the `TestMatryoshkaImpactEstimation` class. - Fixed an unmatched parentheses error in `tests/unit/engine/services/test_config_analyzer.py` on line 203. - Refactored `AsymmetricEmbeddingProviderSettings` in `src/codeweaver/providers/config/categories/embedding.py` to fix overlapping/duplicate method definitions for `dimension_tuple`, `datatype_tuple`, `validate_model_compatibility`, `dimension`, and `datatype`. - Fixed a syntax error introduced during a previous unmerged PR inside `src/codeweaver/providers/config/categories/embedding.py` on line 851. Note: - The tests under `tests/unit/cli/test_config_command.py` still exhibit failures due to `CodeWeaverEngineSettings` mock behavior completely bypassing the actual validation exception `pydantic` would raise (`ValidationError`). This behavior makes `test_invalid_provider_rejected` fail, and should be evaluated further. 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. |
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR targets the syntax and indentation issues uncovered during testing in this refactoring branch, resolving blocking test suite execution.
Changes Made:
Config Analyzer Service Tests (
tests/unit/engine/services/test_config_analyzer.py):config_analyzersetup.Embedding Configuration Categories (
src/codeweaver/providers/config/categories/embedding.py):AsymmetricEmbeddingProviderSettingsclass (dimension_tuple,datatype_tuple,dimension,datatypeproperties)Outstanding Issues & Observations:
TestConfigValidation::test_invalid_provider_rejectedtest case intests/unit/cli/test_config_command.pyfails with the messageFailed: DID NOT RAISE any of (<class 'codeweaver.core.exceptions.CodeWeaverError'>, <class 'ValueError'>, <class 'pydantic_core._pydantic_core.ValidationError'>). Attempting to trigger this by dynamically instantiatingCodeWeaverEngineSettingsvia Python interpreter locally results in anAttributeError: 'Unset' object has no attribute 'embedding'error. I believe this test is fundamentally mismatched against how Pytest's mocks bypass actualpydantic_settingsinstantiation validation inmock_settings_dependency.Next Steps:
CodeWeaverEngineSettingsinside unit tests versus its behavior inside the CLI's_get_settingsinjection. Ifmock_settings_dependencyoverrides settings globally for the CLI scope, the validation logic never triggers. Removing or isolatingTestConfigValidationout of the auto-mock'd contexts may be necessary to properly test thatpydanticflags the error.PR created automatically by Jules for task 8699010726555801512 started by @bashandbone