Skip to content

Commit 36a55f1

Browse files
authored
CI: Enable Testing Against Local *and* Released Driver (#73)
1 parent 761ae20 commit 36a55f1

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

testkit/_common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
import sys
2020

2121

22+
_TRUE_ENV_VALS = {"1", "y", "yes", "true", "t", "on"}
23+
24+
2225
TEST_BACKEND_VERSION = os.getenv("TEST_BACKEND_VERSION", "python")
26+
TEST_LOCAL_DRIVER = (
27+
os.environ.get("TEST_LOCAL_DRIVER", "").lower() in _TRUE_ENV_VALS
28+
)
2329

2430

2531
def run(args, env=None, **kwargs):

testkit/unittests.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
# limitations under the License.
1515

1616

17-
from _common import run_python
17+
from _common import (
18+
run_python,
19+
TEST_LOCAL_DRIVER,
20+
)
1821

1922

2023
if __name__ == "__main__":
21-
run_python(["-m", "tox", "-vv", "-f", "test"])
24+
driver_env = "devdriver" if TEST_LOCAL_DRIVER else "releasedriver"
25+
run_python(["-m", "tox", "-vv", "-f", driver_env, "test"])

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{310,311,312,313}-{test}
2+
envlist = py{310,311,312,313}-{test}-{releasedriver,devdriver}
33

44
[testenv]
55
dependency_groups =
@@ -8,5 +8,7 @@ extras =
88
numpy
99
pandas
1010
pyarrow
11+
commands_pre =
12+
devdriver: python -m pip install ./driver --no-deps
1113
commands =
1214
test: python -m pytest -v --benchmark-skip {posargs} tests

0 commit comments

Comments
 (0)