feat: move Redis family to clientless validation#136
Open
cofin wants to merge 3 commits into
Open
Conversation
cofin
added a commit
that referenced
this pull request
May 25, 2026
Replace the `google.cloud.bigquery` / `google.api_core.client_options` / `google.auth.credentials` imports with a stdlib `urllib.request` REST probe against the emulator's `/bigquery/v2/projects/<project>/queries` endpoint, mirroring the Elasticsearch (#139), Valkey (#138), and Redis family (#136) clientless conversions. - src/pytest_databases/docker/bigquery.py: drop the three `google.*` imports; remove `credentials` and `client_options` from `BigQueryService` (keep `host`, `port`, `container`, `project`, `dataset`, and the `endpoint` property); add a `_query_bigquery_emulator(host, port, project, sql, *, timeout=2.0)` helper that POSTs `{"query": sql, "useLegacySql": false}` and parses the response; rewrite `check()` to call the helper with `SELECT 1 as one` and assert `jobComplete and rows[0].f[0].v == "1"`, swallowing `URLError`/`HTTPError`/`JSONDecodeError`/`TimeoutError`/`OSError`; delete the `bigquery_client` fixture. The emulator `--dataset=` start flag and `DATASET_NAME` env var are preserved so the default dataset is still auto-created by the emulator binary itself. - tests/test_bigquery.py: rewrite to drive the emulator through stdlib `urllib.request` only; preserve `test_service_fixture` (SELECT 1 via REST); drop `test_client_fixture`; rewrite `test_xdist` to issue `CREATE TABLE` against `bigquery_service.dataset` via the REST endpoint; add `test_plugin_imports_without_google_cloud_bigquery` regression guard that intercepts `google.cloud.bigquery`, `google.api_core.client_options`, and `google.auth.credentials` via `builtins.__import__`. - pyproject.toml: empty the `bigquery` compatibility extra so `pytest-databases[bigquery]` no longer pulls in `google-cloud-bigquery`; drop the `pytest_databases.docker.bigquery` `attr-defined` mypy override now that the module no longer touches Google client attribute surface. - docs/supported-databases/bigquery.rst: rewrite the example in the user-owned-client style; users now build their own `bigquery.Client` from `bigquery_service.endpoint`, `bigquery_service.project`, and `AnonymousCredentials()`. - uv.lock: drop `google-cloud-bigquery`, `google-crc32c`, and `google-resumable-media`.
e9bc388 to
ab5fc08
Compare
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.
Move readiness off the
redisPython client. Theredis_service,dragonfly_service, andkeydb_servicefixtures now ping through a small sidecar (redis:latestonnetwork_mode=host) runningredis-cli.tests/test_redis.pydrives every parametrized service through the same sidecar helper, covering image override, default no-xdist, xdist database isolation, and xdist server isolation across the four wire-compatible images (redis,valkey,keydb,dragonflydb).The
redis,keydb, anddragonflyextras are now empty compatibility groups — users install their own client.types-redisis gone from the lint group.