Skip to content

Commit 3a41b63

Browse files
committed
ci(python): expand driver compatibility coverage
1 parent e117a1a commit 3a41b63

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ This repository is a Rust workspace for BendSQL plus a separate frontend, langua
2929
Format: `type(scope): description` or `type: description`.
3030
Allowed types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`.
3131

32+
## Python Binding Compatibility Tests
33+
34+
- Databend CI can run the latest Python binding tests against older driver versions, and BendSQL keeps a similar compatibility matrix so failures are caught here without blocking the main Databend repository.
35+
- When adding or changing tests in `bindings/python/tests/**/steps/binding.py`, guard queries, API usage, and assertions that depend on a particular driver or server version with the existing `DRIVER_VERSION` and/or `DB_VERSION` checks. Refer to the existing uses of these variables in the `binding.py` files: execute only the version-dependent portion when the tested version supports it, while leaving version-independent coverage unconditional.
36+
- Set each version boundary to the first release that supports the behavior. Do not make the older-driver/newer-test compatibility jobs require behavior that is only available in newer driver or server releases.
37+
3238
## Task Routing
3339

3440
- Rust behavior, CLI flags, REPL, output, or public Rust API changes: read `agents/rust-workspace.md`

bindings/python/tests/asyncio/steps/binding.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
tc = unittest.TestCase()
2525

2626
os.environ["DATABEND_DRIVER_HEARTBEAT_INTERVAL_SECONDS"] = "1"
27-
os.environ["RUST_LOG"] = "warn,databend_driver=debug,databend_client=debug"
27+
os.environ.setdefault(
28+
"RUST_LOG",
29+
"warn,databend_driver=debug,databend_client=debug",
30+
)
2831
import databend_driver
2932

3033
NOW = int(time.time())

bindings/python/tests/blocking/steps/binding.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
from behave import given, when, then
2626

2727
os.environ["DATABEND_DRIVER_HEARTBEAT_INTERVAL_SECONDS"] = "1"
28-
os.environ["RUST_LOG"] = "warn,databend_driver=debug,databend_client=debug"
28+
os.environ.setdefault(
29+
"RUST_LOG",
30+
"warn,databend_driver=debug,databend_client=debug",
31+
)
2932
import databend_driver
3033

3134
NOW = int(time.time())

bindings/python/tests/cursor/steps/binding.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
from behave import given, when, then
2222

2323
os.environ["DATABEND_DRIVER_HEARTBEAT_INTERVAL_SECONDS"] = "1"
24-
os.environ["RUST_LOG"] = "warn,databend_driver=debug,databend_client=debug"
24+
os.environ.setdefault(
25+
"RUST_LOG",
26+
"warn,databend_driver=debug,databend_client=debug",
27+
)
2528
import databend_driver
2629

2730
NOW = int(time.time())

tests/nox/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def new_driver_with_old_servers(session, db_version, query_result_format):
4949

5050

5151
def generate_params2():
52-
for driver_version in ["0.28.2", "0.28.1"]:
52+
for driver_version in ["0.27.6", "0.33.6", "0.34.0", "0.34.2"]:
5353
for query_result_format in ["arrow", "json"]:
5454
v = tuple(map(int, driver_version.split(".")))
5555
if query_result_format == "arrow" and v <= (0, 30, 3):

0 commit comments

Comments
 (0)