Repository navigation
test(connector-factory): stop TestValidateConfig depending on asyncpg - #168
Merged
zc277584121 merged 1 commit intoJul 7, 2026
Conversation
Two TestValidateConfig cases used "postgres" as the example connector
and failed in the default `uv run --extra dev pytest` environment
(no asyncpg installed): load_builtin() silently skips registering
postgres when its optional SDK is missing, so get_plugin_cls("postgres")
returned None and validate_config no-opped instead of validating --
"DID NOT RAISE" was a test-environment gap, not a real bug. Verified
by installing `--extra pg`: all 8 cases pass against the real
PostgresConfig schema.
Registers a fake plugin with its own CONFIG_SCHEMA (mirroring
PostgresConfig's dsn/max_read_rows shape) so the class exercises
schema enforcement unconditionally, the same way the existing
_FakePlugin already does for resolve_target. postgres's own
CONFIG_SCHEMA is untouched and still enforced in production.
Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
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.
Summary
tests/test_connector_factory.py::TestValidateConfighad 2 failing cases in the defaultuv run --extra dev pytestenvironment (noasyncpginstalled):test_wrong_type_with_no_coercion_path_is_rejectedandtest_unrecognized_field_is_rejected."postgres"as the example connector.load_builtin()registerspostgresinside atry/except ImportError: pass(same pattern for every optional-SDK connector), so withoutasyncpginstalled,postgresis never registered,get_plugin_cls("postgres")returnsNone, andvalidate_configsilently no-ops instead of validating — "DID NOT RAISE" was a test-environment gap, not a real bug invalidate_config/PostgresConfig. Confirmed by installing--extra pg: all 8TestValidateConfigcases pass against the real schema.CONFIG_SCHEMA(mirroringPostgresConfig'sdsn/max_read_rowsshape), the same pattern the file already uses for_FakePluginin theresolve_targettests above it. The class now exercises schema enforcement unconditionally, independent of which optional connector SDKs happen to be installed.postgres's realCONFIG_SCHEMAis untouched and still enforced in production.Test plan
uv run --extra dev pytest tests/test_connector_factory.py— 61 passed (was 2 failed before).uv run --extra dev pytest— 371 passed, 11 skipped, 0 failed.--extra all-connectorsinstalled — still 61 passed, no regression either way.ruff format --check/ruff checkclean.