Skip to content

Commit 859f76e

Browse files
SNOW-UD: Use shared install script for UD connector swap
Move the Universal Driver connector swap logic into the shared tox_install_cmd.sh (conditional on ud_connector_path) so the UD workflow runs the same tox environments as normal CI instead of dedicated ud/ud-datasource envs. - Add UD swap block to scripts/tox_install_cmd.sh (no-op when unset) - Add ud_connector_path to [testenv] passenv - Remove [testenv:ud] and [testenv:ud-datasource] from tox.ini - Delete scripts/ud_tox_install_cmd.sh - Workflow now invokes py${VER}-notdoctest-ci and datasource directly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9483710 commit 859f76e

4 files changed

Lines changed: 24 additions & 57 deletions

File tree

.github/workflows/ud-inline-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev
8484
8585
- name: Run integration tests
86-
run: python -m tox -e ud
86+
run: python -m tox -e "py${PYTHON_VERSION//.}-notdoctest-ci"
8787
env:
8888
cloud_provider: ${{ env.CLOUD_PROVIDER }}
8989
ud_connector_path: "git+https://github.com/snowflakedb/universal-driver@${{ env.UD_BRANCH }}#subdirectory=python"
@@ -92,7 +92,7 @@ jobs:
9292
TOX_PARALLEL_NO_SPINNER: 1
9393

9494
- name: Run datasource tests
95-
run: python -m tox -e ud-datasource
95+
run: python -m tox -e datasource
9696
env:
9797
cloud_provider: ${{ env.CLOUD_PROVIDER }}
9898
ud_connector_path: "git+https://github.com/snowflakedb/universal-driver@${{ env.UD_BRANCH }}#subdirectory=python"

scripts/tox_install_cmd.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
set -e
44

5+
# ── Standard install ─────────────────────────────────────────────────
6+
# Install project dependencies using uv. This section is shared by
7+
# every tox environment and must remain provider-agnostic.
8+
# ─────────────────────────────────────────────────────────────────────
9+
510
# Check if uv is installed, and install it if not
611
if ! command -v uv &> /dev/null; then
712
echo "uv not found, installing it..."
@@ -33,3 +38,18 @@ else
3338
uv pip install ${snowflake_path}/snowflake_connector_python*${python_version}*.whl
3439
uv pip install ${uv_options[@]}
3540
fi
41+
42+
# ── Universal Driver connector swap ──────────────────────────────────
43+
# When ud_connector_path is set, replace snowflake-connector-python
44+
# with the Universal Driver build. This is a no-op for normal CI.
45+
# ─────────────────────────────────────────────────────────────────────
46+
47+
ud_connector_path=${ud_connector_path:-""}
48+
if [[ -n "${ud_connector_path}" ]]; then
49+
echo "Swapping snowflake-connector-python → Universal Driver"
50+
echo " UD connector path: ${ud_connector_path}"
51+
# --reinstall ensures wheel files are always extracted even if the
52+
# version matches a previous install (uv otherwise skips silently).
53+
uv pip uninstall snowflake-connector-python
54+
uv pip install --reinstall "${ud_connector_path}"
55+
fi

scripts/ud_tox_install_cmd.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

tox.ini

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ passenv =
120120
GITHUB_ENV
121121
SNOWPARK_PYTHON_API_TEST_BUCKET_PATH
122122
SNOWPARK_PYTHON_API_S3_STORAGE_INTEGRATION
123+
; Universal Driver connector path (no-op when unset)
124+
ud_connector_path
123125
commands =
124126
notudf: {env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE} and not udf" {posargs:} {env:RERUN_FLAGS} src/snowflake/snowpark tests
125127
udf: {env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE} or udf" {posargs:} {env:RERUN_FLAGS} src/snowflake/snowpark tests
@@ -264,44 +266,6 @@ deps =
264266
commands =
265267
{env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE}" {posargs:} tests/integ/datasource -n 8
266268

267-
[testenv:ud]
268-
description = run integration tests with Universal Driver connector
269-
allowlist_externals = bash
270-
install_command = bash ./scripts/ud_tox_install_cmd.sh {opts} {packages}
271-
passenv =
272-
{[testenv]passenv}
273-
ud_connector_path
274-
LD_PRELOAD
275-
setenv =
276-
{[testenv]setenv}
277-
SNOWFLAKE_PYTEST_VERBOSITY = -vvv
278-
SNOWFLAKE_PYTEST_PARALLELISM = -n logical
279-
SNOWFLAKE_TEST_TYPE = (unit or integ or doctest)
280-
LD_PRELOAD = {env:LD_PRELOAD:}
281-
commands =
282-
{env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE} or udf" {posargs:} {env:RERUN_FLAGS} tests
283-
284-
[testenv:ud-datasource]
285-
description = run datasource tests with Universal Driver connector
286-
allowlist_externals = bash
287-
install_command = bash ./scripts/ud_tox_install_cmd.sh {opts} {packages}
288-
passenv =
289-
{[testenv]passenv}
290-
ud_connector_path
291-
LD_PRELOAD
292-
setenv =
293-
{[testenv]setenv}
294-
LD_PRELOAD = {env:LD_PRELOAD:}
295-
deps =
296-
{[testenv]deps}
297-
databricks-sql-connector > 4.0.0
298-
oracledb
299-
psycopg2-binary
300-
pymysql
301-
pyodbc
302-
commands =
303-
{env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE}" {posargs:} tests/integ/datasource -n 8
304-
305269
[pytest]
306270
log_cli = True
307271
log_cli_level = DEBUG

0 commit comments

Comments
 (0)