650b1038b6
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Failing after 19s
CI / typecheck (pull_request) Failing after 56s
CI / security (pull_request) Failing after 56s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 2m4s
CI / docker (pull_request) Has been skipped
CI / build (pull_request) Successful in 16s
CI / helm (pull_request) Successful in 23s
CI / quality (pull_request) Successful in 3m42s
CI / e2e_tests (pull_request) Failing after 15m14s
CI / integration_tests (pull_request) Failing after 22m3s
CI / status-check (pull_request) Failing after 1s
Introduce DomainBaseModel in src/cleveragents/domain/models/base.py that defines the single shared model_config (str_strip_whitespace, validate_assignment, arbitrary_types_allowed=False, populate_by_name, use_enum_values) previously duplicated verbatim across five domain model files. Update 14 classes across five files to inherit from DomainBaseModel instead of pydantic.BaseModel directly, removing all inline model_config duplication: - aimodelscredentials/ai_models_credentials.py (ModelProviderOption) - aimodelserrors/ai_models_errors.py (ModelError, FallbackResult) - aimodelsproviders/ai_models_providers.py (ModelProviderExtraAuthVars, ModelProviderConfigSchema) - auth/auth.py (AuthHeader, TrialPlansExceededError, TrialMessagesExceededError, BillingError, ApiError, ClientAccount, ClientAuth) - planconfig/plan_config.py (PlanConfig, ConfigSetting) Pure structural refactor — no behavioral changes. Models with different configurations (acms, aimodels_custom, etc.) are left untouched. Add BDD feature (22 scenarios) and Robot integration tests (8 test cases) verifying inheritance, config correctness, and no-duplication invariants. ISSUES CLOSED: #1941
62 lines
3.2 KiB
Plaintext
62 lines
3.2 KiB
Plaintext
*** Settings ***
|
|
Documentation Integration smoke tests for DomainBaseModel refactor.
|
|
...
|
|
... Verifies that extracting the shared model_config into
|
|
... DomainBaseModel has not changed the observable behaviour of
|
|
... any affected domain model class.
|
|
Resource ${CURDIR}/common.resource
|
|
Suite Setup Setup Test Environment
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Variables ***
|
|
${HELPER_SCRIPT} robot/helper_domain_base_model.py
|
|
|
|
*** Test Cases ***
|
|
DomainBaseModel Is Importable
|
|
[Documentation] DomainBaseModel can be imported and is a pydantic BaseModel subclass
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} importable cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} domain-base-model-importable-ok
|
|
|
|
DomainBaseModel Carries Expected Config
|
|
[Documentation] DomainBaseModel model_config has all expected settings
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} config cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} domain-base-model-config-ok
|
|
|
|
ModelProviderOption Behaviour Unchanged
|
|
[Documentation] ModelProviderOption works correctly after inheriting from DomainBaseModel
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} model-provider-option cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} model-provider-option-ok
|
|
|
|
ModelError Behaviour Unchanged
|
|
[Documentation] ModelError works correctly after inheriting from DomainBaseModel
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} model-error cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} model-error-ok
|
|
|
|
FallbackResult Behaviour Unchanged
|
|
[Documentation] FallbackResult works correctly after inheriting from DomainBaseModel
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} fallback-result cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} fallback-result-ok
|
|
|
|
Auth Models Behaviour Unchanged
|
|
[Documentation] All auth domain models work correctly after inheriting from DomainBaseModel
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} auth-models cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} auth-models-ok
|
|
|
|
PlanConfig Models Behaviour Unchanged
|
|
[Documentation] PlanConfig and ConfigSetting work correctly after inheriting from DomainBaseModel
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} plan-config-models cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} plan-config-models-ok
|
|
|
|
Whitespace Stripping Active On Refactored Models
|
|
[Documentation] str_strip_whitespace config is active on all refactored models
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} whitespace-stripping cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} whitespace-stripping-ok
|