Repository navigation
test(config): fix all 9 stale failures in the config suite (#12774) - #12821
Merged
Merged
Conversation
config/ went 9 failed, 93 passed -> 102 passed. Every failure was a test asserting an API, module or value that no longer exists — the same class as #12668 (stale attrs) and #12673 (environment-dependent assertions), not product bugs. Each was verified against the real implementation before rewriting. validation_test (2): GH#9232 removed backend.server_host from the required set — _REQUIRED_CONFIG_KEYS is now literally empty because it defaults to 0.0.0.0. The tests asserted it WAS required. Rather than delete the coverage, the is-None-vs- falsy invariant the class exists for is now exercised against memory.redis.host, which IS still conditionally required and IS still gated on `if value is None`. timeout_configuration_test (1): assigned `config.llm_timeout = "999.0"` then asserted `"AUTOBOT_LLM_TIMEOUT" in os.environ`. Assignment to the proxy does not write the environment; the test's own comment conceded it only "test[ed] the mechanism exists". The real mechanism is pydantic-settings reading env at construction, and the module-level proxy is cached — so the override is now observed on a fresh AutoBotConfig(), confirmed 999 with the env var and the default without it. config_migration_integration_test (6), all verified against the live objects: - ConfigManager.get() is a FLAT dict lookup (config/sync_ops.py) — it resolves neither dotted paths nor env vars. Dotted lookups now use get_nested(). - get_section() -> get_config_section() (renamed). - set() is likewise flat, so nested writes now use set_nested() — this is why the multimodal processor read 0.7 instead of the 0.9 the test had "set". - `utils.config_manager` no longer exists; `from config import config` yields the SSOT _ConfigProxy which has neither .get nor .config. The legacy wrapper is config.compat.Config. - "llm" is not a top-level section (LLM config lives under backend.llm), and llm.orchestrator_llm / llm.ollama.port do not exist anywhere — the old equality assertion compared None to None and was vacuous. Replaced with keys that exist. - redis.host was pinned to ["localhost","127.0.0.1"]; it is an SSOT deployment value, so that failed on any real deployment. Now asserted to be a non-empty string. Closes #12774
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
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.
Thinking Path
config/was 9 failed, 93 passed. Every one turned out to be a test asserting an API, module or value that no longer exists — the same class as #12668 (stale attributes) and #12673 (environment-dependent assertions) — not product bugs. So the work was verifying what each subject actually does now, then retargeting the test at that, rather than "making it pass".The recurring trap:
ConfigManager.get()and.set()are flat dict operations (config/sync_ops.py). They resolve neither dotted paths nor env vars. Six of the nine failures trace back to tests assuming otherwise.What Changed
validation_test(2) — GH#9232 removedbackend.server_hostfrom the required set;_REQUIRED_CONFIG_KEYSis now literally empty because it defaults to0.0.0.0. The tests asserted it was required.Rather than delete the coverage, I kept the invariant the class exists for. Its docstring is "Ensure
is None(not truthiness) is used for required-key checks" — so that distinction is now exercised againstmemory.redis.host, which is still conditionally required and is still gated onif value is None. The falsy-but-present side ('0') was already covered.timeout_configuration_test(1) — assignedconfig.llm_timeout = "999.0"then asserted"AUTOBOT_LLM_TIMEOUT" in os.environ. Assignment to the proxy doesn't write the environment; the test's own comment conceded it only "test[ed] the mechanism exists".The real mechanism is pydantic-settings reading env at construction, and the module-level proxy is built once and cached. Verified directly before rewriting:
config_migration_integration_test(6) — each verified against the live objects:cm.get("a.b.c")get_nested()cm.set("a.b.c", v)set_nested(); this is why the processor read0.7not the0.9the test "set"get_section()get_config_section()from utils.config_manager import configfrom config import config_ConfigProxy— has neither.getnor.config; the legacy wrapper isconfig.compat.Config"llm"top-level sectionbackend.llmllm.orchestrator_llm/llm.ollama.portNonetoNoneand was vacuousredis.host in ["localhost","127.0.0.1"]Verification
Two of these were fixed by making the assertion stronger, not weaker: the backward-compat check now compares a key that actually exists (the previous one was vacuously true), and the required-key test now targets a key that is genuinely still required.
Model Used
Claude Opus 5 (1M context)
Closes #12774