From 2a3d0c3291ce24a06caf19e1c2b84125c0e2f116 Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Thu, 12 Mar 2026 18:54:53 +0000 Subject: [PATCH 01/12] SNOW-UD: Add inline UD test workflow with isolated tox environments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add ud-inline-tests.yml (workflow_dispatch only) to run Snowpark tests against the universal-driver Python connector installed from git+https. - Add scripts/ud_tox_install_cmd.sh — wrapper that delegates to the standard tox_install_cmd.sh, then swaps snowflake-connector-python for the UD connector. Original install script is untouched. - Add [testenv:ud] and [testenv:ud-datasource] to tox.ini with their own install_command, passenv, and setenv. No changes to [testenv]. No behavior change for regular Snowpark CI — UD install logic is fully isolated in the new wrapper script and testenv sections. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ud-inline-tests.yml | 99 +++++++++++++++++++++++++++ scripts/ud_tox_install_cmd.sh | 17 +++++ tox.ini | 38 ++++++++++ 3 files changed, 154 insertions(+) create mode 100644 .github/workflows/ud-inline-tests.yml create mode 100755 scripts/ud_tox_install_cmd.sh diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml new file mode 100644 index 0000000000..4c2c087c1e --- /dev/null +++ b/.github/workflows/ud-inline-tests.yml @@ -0,0 +1,99 @@ +name: Run UD tests inline (manual) + +on: + workflow_dispatch: + inputs: + ud-branch: + description: 'Branch of universal-driver repo to use' + required: false + default: 'snowpark-compatibility' + type: string + python-version: + description: 'Python version' + required: false + default: '3.10' + type: choice + options: + - '3.10' + - '3.11' + - '3.12' + - '3.13' + cloud-provider: + description: 'Cloud provider' + required: false + default: 'aws' + type: choice + options: + - 'aws' + - 'azure' + - 'gcp' + +permissions: + contents: read + +env: + PYTHON_VERSION: ${{ inputs.python-version || '3.10' }} + CLOUD_PROVIDER: ${{ inputs.cloud-provider || 'aws' }} + UD_BRANCH: ${{ inputs.ud-branch || 'snowpark-compatibility' }} + +jobs: + test: + name: UD Test py${{ inputs.python-version || '3.10' }}-${{ inputs.cloud-provider || 'aws' }} (${{ inputs.ud-branch || 'snowpark-compatibility' }}) + runs-on: ubuntu-latest-64-cores + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - run: python -c "import sys; print(sys.version)" + + - uses: astral-sh/setup-uv@v6 + + - name: Decrypt parameters.py + run: .github/scripts/decrypt_parameters.sh + env: + PARAMETER_PASSWORD: ${{ secrets.PARAMETER_PASSWORD }} + CLOUD_PROVIDER: ${{ env.CLOUD_PROVIDER }} + + - name: Install protoc + run: .github/scripts/install_protoc.sh + + - name: Configure git credentials for universal-driver + run: | + git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/" + env: + GH_TOKEN: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} + + - name: Install tox + run: uv pip install tox --system + + - name: Install MS ODBC Driver + run: | + curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - + curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list \ + | sudo tee /etc/apt/sources.list.d/mssql-release.list + sudo apt-get update + sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev + + - name: Run integration tests + run: python -m tox -e ud + env: + cloud_provider: ${{ env.CLOUD_PROVIDER }} + ud_connector_path: "git+https://github.com/snowflakedb/universal-driver@${{ env.UD_BRANCH }}#subdirectory=python" + GH_TOKEN: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} + PYTEST_ADDOPTS: --color=yes --tb=short + TOX_PARALLEL_NO_SPINNER: 1 + + - name: Run datasource tests + run: python -m tox -e ud-datasource + env: + cloud_provider: ${{ env.CLOUD_PROVIDER }} + ud_connector_path: "git+https://github.com/snowflakedb/universal-driver@${{ env.UD_BRANCH }}#subdirectory=python" + GH_TOKEN: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} + PYTEST_ADDOPTS: --color=yes --tb=short + TOX_PARALLEL_NO_SPINNER: 1 diff --git a/scripts/ud_tox_install_cmd.sh b/scripts/ud_tox_install_cmd.sh new file mode 100755 index 0000000000..f370b5c6f5 --- /dev/null +++ b/scripts/ud_tox_install_cmd.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -e + +# Run normal install first (deps + project) +bash ./scripts/tox_install_cmd.sh "$@" + +# Swap connector if ud_connector_path is set +ud_connector_path=${ud_connector_path:-""} +if [[ -n "${ud_connector_path}" ]]; then + echo "Swapping snowflake-connector-python → Universal Driver" + echo "UD connector path: ${ud_connector_path}" + # Remove old connector and install UD in its place. + # --reinstall ensures wheel files are always extracted even if the version + # matches a previous install (uv otherwise skips re-extraction silently). + uv pip uninstall snowflake-connector-python + uv pip install --reinstall "${ud_connector_path}" +fi diff --git a/tox.ini b/tox.ini index 190992de62..2ecf5f4314 100644 --- a/tox.ini +++ b/tox.ini @@ -264,6 +264,44 @@ deps = commands = {env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE}" {posargs:} tests/integ/datasource -n 8 +[testenv:ud] +description = run integration tests with Universal Driver connector +allowlist_externals = bash +install_command = bash ./scripts/ud_tox_install_cmd.sh {opts} {packages} +passenv = + {[testenv]passenv} + ud_connector_path + LD_PRELOAD +setenv = + {[testenv]setenv} + SNOWFLAKE_PYTEST_VERBOSITY = -vvv + SNOWFLAKE_PYTEST_PARALLELISM = -n logical + SNOWFLAKE_TEST_TYPE = (unit or integ or doctest) + LD_PRELOAD = {env:LD_PRELOAD:} +commands = + {env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE} or udf" {posargs:} {env:RERUN_FLAGS} tests + +[testenv:ud-datasource] +description = run datasource tests with Universal Driver connector +allowlist_externals = bash +install_command = bash ./scripts/ud_tox_install_cmd.sh {opts} {packages} +passenv = + {[testenv]passenv} + ud_connector_path + LD_PRELOAD +setenv = + {[testenv]setenv} + LD_PRELOAD = {env:LD_PRELOAD:} +deps = + {[testenv]deps} + databricks-sql-connector > 4.0.0 + oracledb + psycopg2-binary + pymysql + pyodbc +commands = + {env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE}" {posargs:} tests/integ/datasource -n 8 + [pytest] log_cli = True log_cli_level = DEBUG From c006e1fc567465ec8e61c0246a3d6211d18389fb Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Thu, 12 Mar 2026 19:03:39 +0000 Subject: [PATCH 02/12] SNOW-UD: Temporarily enable pull_request trigger for UD workflow TODO: remove pull_request trigger once all tests are passing. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ud-inline-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml index 4c2c087c1e..abadd4e05a 100644 --- a/.github/workflows/ud-inline-tests.yml +++ b/.github/workflows/ud-inline-tests.yml @@ -1,6 +1,8 @@ name: Run UD tests inline (manual) on: + # TODO: remove pull_request once all tests are passing — keep workflow_dispatch only + pull_request: workflow_dispatch: inputs: ud-branch: From 941b1e14db2bd1e18e070c946167777246a75087 Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Thu, 12 Mar 2026 19:27:36 +0000 Subject: [PATCH 03/12] 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) --- .github/workflows/ud-inline-tests.yml | 4 +-- scripts/tox_install_cmd.sh | 20 ++++++++++++++ scripts/ud_tox_install_cmd.sh | 17 ------------ tox.ini | 40 ++------------------------- 4 files changed, 24 insertions(+), 57 deletions(-) delete mode 100755 scripts/ud_tox_install_cmd.sh diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml index abadd4e05a..8f671248a0 100644 --- a/.github/workflows/ud-inline-tests.yml +++ b/.github/workflows/ud-inline-tests.yml @@ -83,7 +83,7 @@ jobs: sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev - name: Run integration tests - run: python -m tox -e ud + run: python -m tox -e "py${PYTHON_VERSION//.}-notdoctest-ci" env: cloud_provider: ${{ env.CLOUD_PROVIDER }} ud_connector_path: "git+https://github.com/snowflakedb/universal-driver@${{ env.UD_BRANCH }}#subdirectory=python" @@ -92,7 +92,7 @@ jobs: TOX_PARALLEL_NO_SPINNER: 1 - name: Run datasource tests - run: python -m tox -e ud-datasource + run: python -m tox -e datasource env: cloud_provider: ${{ env.CLOUD_PROVIDER }} ud_connector_path: "git+https://github.com/snowflakedb/universal-driver@${{ env.UD_BRANCH }}#subdirectory=python" diff --git a/scripts/tox_install_cmd.sh b/scripts/tox_install_cmd.sh index 31ea14f02d..8f3928c0dc 100755 --- a/scripts/tox_install_cmd.sh +++ b/scripts/tox_install_cmd.sh @@ -2,6 +2,11 @@ set -e +# ── Standard install ───────────────────────────────────────────────── +# Install project dependencies using uv. This section is shared by +# every tox environment and must remain provider-agnostic. +# ───────────────────────────────────────────────────────────────────── + # Check if uv is installed, and install it if not if ! command -v uv &> /dev/null; then echo "uv not found, installing it..." @@ -33,3 +38,18 @@ else uv pip install ${snowflake_path}/snowflake_connector_python*${python_version}*.whl uv pip install ${uv_options[@]} fi + +# ── Universal Driver connector swap ────────────────────────────────── +# When ud_connector_path is set, replace snowflake-connector-python +# with the Universal Driver build. This is a no-op for normal CI. +# ───────────────────────────────────────────────────────────────────── + +ud_connector_path=${ud_connector_path:-""} +if [[ -n "${ud_connector_path}" ]]; then + echo "Swapping snowflake-connector-python → Universal Driver" + echo " UD connector path: ${ud_connector_path}" + # --reinstall ensures wheel files are always extracted even if the + # version matches a previous install (uv otherwise skips silently). + uv pip uninstall snowflake-connector-python + uv pip install --reinstall "${ud_connector_path}" +fi diff --git a/scripts/ud_tox_install_cmd.sh b/scripts/ud_tox_install_cmd.sh deleted file mode 100755 index f370b5c6f5..0000000000 --- a/scripts/ud_tox_install_cmd.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Run normal install first (deps + project) -bash ./scripts/tox_install_cmd.sh "$@" - -# Swap connector if ud_connector_path is set -ud_connector_path=${ud_connector_path:-""} -if [[ -n "${ud_connector_path}" ]]; then - echo "Swapping snowflake-connector-python → Universal Driver" - echo "UD connector path: ${ud_connector_path}" - # Remove old connector and install UD in its place. - # --reinstall ensures wheel files are always extracted even if the version - # matches a previous install (uv otherwise skips re-extraction silently). - uv pip uninstall snowflake-connector-python - uv pip install --reinstall "${ud_connector_path}" -fi diff --git a/tox.ini b/tox.ini index 2ecf5f4314..72c490e113 100644 --- a/tox.ini +++ b/tox.ini @@ -120,6 +120,8 @@ passenv = GITHUB_ENV SNOWPARK_PYTHON_API_TEST_BUCKET_PATH SNOWPARK_PYTHON_API_S3_STORAGE_INTEGRATION + ; Universal Driver connector path (no-op when unset) + ud_connector_path commands = notudf: {env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE} and not udf" {posargs:} {env:RERUN_FLAGS} src/snowflake/snowpark tests 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 = commands = {env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE}" {posargs:} tests/integ/datasource -n 8 -[testenv:ud] -description = run integration tests with Universal Driver connector -allowlist_externals = bash -install_command = bash ./scripts/ud_tox_install_cmd.sh {opts} {packages} -passenv = - {[testenv]passenv} - ud_connector_path - LD_PRELOAD -setenv = - {[testenv]setenv} - SNOWFLAKE_PYTEST_VERBOSITY = -vvv - SNOWFLAKE_PYTEST_PARALLELISM = -n logical - SNOWFLAKE_TEST_TYPE = (unit or integ or doctest) - LD_PRELOAD = {env:LD_PRELOAD:} -commands = - {env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE} or udf" {posargs:} {env:RERUN_FLAGS} tests - -[testenv:ud-datasource] -description = run datasource tests with Universal Driver connector -allowlist_externals = bash -install_command = bash ./scripts/ud_tox_install_cmd.sh {opts} {packages} -passenv = - {[testenv]passenv} - ud_connector_path - LD_PRELOAD -setenv = - {[testenv]setenv} - LD_PRELOAD = {env:LD_PRELOAD:} -deps = - {[testenv]deps} - databricks-sql-connector > 4.0.0 - oracledb - psycopg2-binary - pymysql - pyodbc -commands = - {env:SNOWFLAKE_PYTEST_CMD} -m "{env:SNOWFLAKE_TEST_TYPE}" {posargs:} tests/integ/datasource -n 8 - [pytest] log_cli = True log_cli_level = DEBUG From 20feb947402e551390f7288802f66c5241b5e444 Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Thu, 12 Mar 2026 19:29:45 +0000 Subject: [PATCH 04/12] =?UTF-8?q?SNOW-UD:=20Fix=20tox=5Finstall=5Fcmd.sh?= =?UTF-8?q?=20=E2=80=94=20integrate=20UD=20as=20first-priority=20branch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the appended swap block with a proper 3-way conditional: ud_connector_path → snowflake_path → PyPI (in priority order). The appended approach ran the full PyPI install then the swap as a separate pass on every tox install_command invocation. The integrated approach mirrors the original design: UD takes explicit priority, snowflake_path is only used when UD is not set, and a single logical path runs per invocation. Also removes the decorative comment banners added by the previous edit, which were inconsistent with the surrounding code style. Co-Authored-By: Claude Opus 4.6 --- scripts/tox_install_cmd.sh | 39 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/scripts/tox_install_cmd.sh b/scripts/tox_install_cmd.sh index 8f3928c0dc..67dce22fe6 100755 --- a/scripts/tox_install_cmd.sh +++ b/scripts/tox_install_cmd.sh @@ -2,11 +2,6 @@ set -e -# ── Standard install ───────────────────────────────────────────────── -# Install project dependencies using uv. This section is shared by -# every tox environment and must remain provider-agnostic. -# ───────────────────────────────────────────────────────────────────── - # Check if uv is installed, and install it if not if ! command -v uv &> /dev/null; then echo "uv not found, installing it..." @@ -24,32 +19,28 @@ done echo "${uv_options[*]}" -# Default to empty, to ensure snowflake_path variable is defined. +# Default to empty, to ensure variables are defined. snowflake_path=${snowflake_path:-""} +ud_connector_path=${ud_connector_path:-""} python_version=$(python -c 'import sys; print(f"cp{sys.version_info.major}{sys.version_info.minor}")') -if [[ -z "${snowflake_path}" ]]; then - echo "Using Python Connector from PyPI" +if [[ -n "${ud_connector_path}" ]]; then + echo "Installing Universal Driver connector" + echo "UD connector path: ${ud_connector_path}" + # Install all deps normally (old connector gets pulled in via snowflake-connector-python>=3.17.0) uv pip install ${uv_options[@]} -else + # Remove old connector and install UD in its place. + # --reinstall ensures wheel files are always extracted even if the version + # matches a previous install (uv otherwise skips re-extraction silently). + uv pip uninstall snowflake-connector-python + uv pip install --reinstall "${ud_connector_path}" +elif [[ -n "${snowflake_path}" ]]; then echo "Installing locally built Python Connector" echo "Python Connector path: ${snowflake_path}" ls -al ${snowflake_path} uv pip install ${snowflake_path}/snowflake_connector_python*${python_version}*.whl uv pip install ${uv_options[@]} -fi - -# ── Universal Driver connector swap ────────────────────────────────── -# When ud_connector_path is set, replace snowflake-connector-python -# with the Universal Driver build. This is a no-op for normal CI. -# ───────────────────────────────────────────────────────────────────── - -ud_connector_path=${ud_connector_path:-""} -if [[ -n "${ud_connector_path}" ]]; then - echo "Swapping snowflake-connector-python → Universal Driver" - echo " UD connector path: ${ud_connector_path}" - # --reinstall ensures wheel files are always extracted even if the - # version matches a previous install (uv otherwise skips silently). - uv pip uninstall snowflake-connector-python - uv pip install --reinstall "${ud_connector_path}" +else + echo "Using Python Connector from PyPI" + uv pip install ${uv_options[@]} fi From 44cf53e545e742b7ff654c8375bd9c4e82c3b2a2 Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Fri, 13 Mar 2026 06:42:28 +0000 Subject: [PATCH 05/12] SNOW-UD: Add doctest step, default Python to 3.13 - Add 'Run doctest' step using py${PYTHON_VERSION}-doctest-notudf-ci, matching the pattern from daily_precommit.yml. - Change default python-version input from 3.10 to 3.13 (latest Snowflake-supported Python). Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ud-inline-tests.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml index 8f671248a0..ff56ba3c1e 100644 --- a/.github/workflows/ud-inline-tests.yml +++ b/.github/workflows/ud-inline-tests.yml @@ -13,7 +13,7 @@ on: python-version: description: 'Python version' required: false - default: '3.10' + default: '3.13' type: choice options: - '3.10' @@ -34,13 +34,13 @@ permissions: contents: read env: - PYTHON_VERSION: ${{ inputs.python-version || '3.10' }} + PYTHON_VERSION: ${{ inputs.python-version || '3.13' }} CLOUD_PROVIDER: ${{ inputs.cloud-provider || 'aws' }} UD_BRANCH: ${{ inputs.ud-branch || 'snowpark-compatibility' }} jobs: test: - name: UD Test py${{ inputs.python-version || '3.10' }}-${{ inputs.cloud-provider || 'aws' }} (${{ inputs.ud-branch || 'snowpark-compatibility' }}) + name: UD Test py${{ inputs.python-version || '3.13' }}-${{ inputs.cloud-provider || 'aws' }} (${{ inputs.ud-branch || 'snowpark-compatibility' }}) runs-on: ubuntu-latest-64-cores steps: @@ -91,6 +91,15 @@ jobs: PYTEST_ADDOPTS: --color=yes --tb=short TOX_PARALLEL_NO_SPINNER: 1 + - name: Run doctest + run: python -m tox -e "py${PYTHON_VERSION}-doctest-notudf-ci" + env: + cloud_provider: ${{ env.CLOUD_PROVIDER }} + ud_connector_path: "git+https://github.com/snowflakedb/universal-driver@${{ env.UD_BRANCH }}#subdirectory=python" + GH_TOKEN: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} + PYTEST_ADDOPTS: --color=yes --tb=short + TOX_PARALLEL_NO_SPINNER: 1 + - name: Run datasource tests run: python -m tox -e datasource env: From 676f3754d6ad160f23d75615c771f3d588cf8d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Paw=C5=82owski?= Date: Fri, 13 Mar 2026 21:33:50 +0100 Subject: [PATCH 06/12] PULL REQUEST REMOVED --- .github/workflows/ud-inline-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml index ff56ba3c1e..88a83e6aae 100644 --- a/.github/workflows/ud-inline-tests.yml +++ b/.github/workflows/ud-inline-tests.yml @@ -1,8 +1,6 @@ name: Run UD tests inline (manual) on: - # TODO: remove pull_request once all tests are passing — keep workflow_dispatch only - pull_request: workflow_dispatch: inputs: ud-branch: From 566d80f83e06428202ba0820921b03ecaa6c830c Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Wed, 22 Apr 2026 09:57:22 +0000 Subject: [PATCH 07/12] Revert "PULL REQUEST REMOVED" This reverts commit 676f3754d6ad160f23d75615c771f3d588cf8d45. --- .github/workflows/ud-inline-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml index 88a83e6aae..ff56ba3c1e 100644 --- a/.github/workflows/ud-inline-tests.yml +++ b/.github/workflows/ud-inline-tests.yml @@ -1,6 +1,8 @@ name: Run UD tests inline (manual) on: + # TODO: remove pull_request once all tests are passing — keep workflow_dispatch only + pull_request: workflow_dispatch: inputs: ud-branch: From 3f2c66654bd970d4f7398f73ea46a6c829abd60c Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Wed, 22 Apr 2026 11:04:24 +0000 Subject: [PATCH 08/12] Add pytest-addopts input to UD inline tests workflow Allow filtering which tests run via workflow_dispatch by passing extra pytest arguments (e.g. -k, --maxfail). Doctest and datasource steps are automatically skipped when a filter is active. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ud-inline-tests.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml index ff56ba3c1e..e748bb5b47 100644 --- a/.github/workflows/ud-inline-tests.yml +++ b/.github/workflows/ud-inline-tests.yml @@ -29,6 +29,11 @@ on: - 'aws' - 'azure' - 'gcp' + pytest-addopts: + description: 'Extra pytest args, e.g. "-k test_dataframe" or "--maxfail=5"' + required: false + default: '' + type: string permissions: contents: read @@ -37,6 +42,7 @@ env: PYTHON_VERSION: ${{ inputs.python-version || '3.13' }} CLOUD_PROVIDER: ${{ inputs.cloud-provider || 'aws' }} UD_BRANCH: ${{ inputs.ud-branch || 'snowpark-compatibility' }} + EXTRA_PYTEST_ADDOPTS: ${{ inputs.pytest-addopts || '' }} jobs: test: @@ -88,23 +94,25 @@ jobs: cloud_provider: ${{ env.CLOUD_PROVIDER }} ud_connector_path: "git+https://github.com/snowflakedb/universal-driver@${{ env.UD_BRANCH }}#subdirectory=python" GH_TOKEN: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} - PYTEST_ADDOPTS: --color=yes --tb=short + PYTEST_ADDOPTS: --color=yes --tb=short ${{ env.EXTRA_PYTEST_ADDOPTS }} TOX_PARALLEL_NO_SPINNER: 1 - name: Run doctest + if: ${{ env.EXTRA_PYTEST_ADDOPTS == '' }} run: python -m tox -e "py${PYTHON_VERSION}-doctest-notudf-ci" env: cloud_provider: ${{ env.CLOUD_PROVIDER }} ud_connector_path: "git+https://github.com/snowflakedb/universal-driver@${{ env.UD_BRANCH }}#subdirectory=python" GH_TOKEN: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} - PYTEST_ADDOPTS: --color=yes --tb=short + PYTEST_ADDOPTS: --color=yes --tb=short ${{ env.EXTRA_PYTEST_ADDOPTS }} TOX_PARALLEL_NO_SPINNER: 1 - name: Run datasource tests + if: ${{ env.EXTRA_PYTEST_ADDOPTS == '' }} run: python -m tox -e datasource env: cloud_provider: ${{ env.CLOUD_PROVIDER }} ud_connector_path: "git+https://github.com/snowflakedb/universal-driver@${{ env.UD_BRANCH }}#subdirectory=python" GH_TOKEN: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} - PYTEST_ADDOPTS: --color=yes --tb=short + PYTEST_ADDOPTS: --color=yes --tb=short ${{ env.EXTRA_PYTEST_ADDOPTS }} TOX_PARALLEL_NO_SPINNER: 1 From ab4b9352c42f9310fddfce2b02be094971468481 Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Wed, 22 Apr 2026 11:10:16 +0000 Subject: [PATCH 09/12] Temporarily limit UD tests to test_stored_procedure.py Default the pytest-addopts filter to a single representative test file while we iterate on UD compatibility. Remove the default once the full suite passes. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ud-inline-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml index e748bb5b47..f7c370e9d4 100644 --- a/.github/workflows/ud-inline-tests.yml +++ b/.github/workflows/ud-inline-tests.yml @@ -32,7 +32,8 @@ on: pytest-addopts: description: 'Extra pytest args, e.g. "-k test_dataframe" or "--maxfail=5"' required: false - default: '' + # TODO: remove default filter once full suite is passing against UD + default: 'tests/integ/test_stored_procedure.py' type: string permissions: From eb4091beec6c279834f2f94cb6c2583bce09d4a6 Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Wed, 22 Apr 2026 11:21:46 +0000 Subject: [PATCH 10/12] Fix UD test filter to apply on PR triggers too workflow_dispatch defaults don't apply on pull_request triggers, so move the temporary test subset fallback into the env var resolution where it covers both trigger types. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ud-inline-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml index f7c370e9d4..75614cb11c 100644 --- a/.github/workflows/ud-inline-tests.yml +++ b/.github/workflows/ud-inline-tests.yml @@ -32,8 +32,7 @@ on: pytest-addopts: description: 'Extra pytest args, e.g. "-k test_dataframe" or "--maxfail=5"' required: false - # TODO: remove default filter once full suite is passing against UD - default: 'tests/integ/test_stored_procedure.py' + default: '' type: string permissions: @@ -43,7 +42,8 @@ env: PYTHON_VERSION: ${{ inputs.python-version || '3.13' }} CLOUD_PROVIDER: ${{ inputs.cloud-provider || 'aws' }} UD_BRANCH: ${{ inputs.ud-branch || 'snowpark-compatibility' }} - EXTRA_PYTEST_ADDOPTS: ${{ inputs.pytest-addopts || '' }} + # TODO: change fallback back to '' once full suite passes against UD + EXTRA_PYTEST_ADDOPTS: ${{ inputs.pytest-addopts || 'tests/integ/test_stored_procedure.py' }} jobs: test: From 8ece0a67d256ab9c37fb48e9bd5d2a7119c573d6 Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Wed, 22 Apr 2026 11:34:28 +0000 Subject: [PATCH 11/12] Fix UD test filter to use -k instead of file path File paths in PYTEST_ADDOPTS don't restrict collection when tox already passes `tests` as a positional arg. Use -k filtering instead, with -v --tb=long -x for immediate verbose feedback. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ud-inline-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml index 75614cb11c..74f2cbff57 100644 --- a/.github/workflows/ud-inline-tests.yml +++ b/.github/workflows/ud-inline-tests.yml @@ -43,7 +43,7 @@ env: CLOUD_PROVIDER: ${{ inputs.cloud-provider || 'aws' }} UD_BRANCH: ${{ inputs.ud-branch || 'snowpark-compatibility' }} # TODO: change fallback back to '' once full suite passes against UD - EXTRA_PYTEST_ADDOPTS: ${{ inputs.pytest-addopts || 'tests/integ/test_stored_procedure.py' }} + EXTRA_PYTEST_ADDOPTS: ${{ inputs.pytest-addopts || '-k test_stored_procedure -v --tb=long -x' }} jobs: test: From bba3ae5f0440c8c3603283619fc2f7f971d8445e Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Wed, 22 Apr 2026 12:16:00 +0000 Subject: [PATCH 12/12] Run full UD test suite with verbose output Remove -k filter and -x to get a complete picture of all UD connector failures in one run. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ud-inline-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ud-inline-tests.yml b/.github/workflows/ud-inline-tests.yml index 74f2cbff57..1f0d0d3834 100644 --- a/.github/workflows/ud-inline-tests.yml +++ b/.github/workflows/ud-inline-tests.yml @@ -43,7 +43,7 @@ env: CLOUD_PROVIDER: ${{ inputs.cloud-provider || 'aws' }} UD_BRANCH: ${{ inputs.ud-branch || 'snowpark-compatibility' }} # TODO: change fallback back to '' once full suite passes against UD - EXTRA_PYTEST_ADDOPTS: ${{ inputs.pytest-addopts || '-k test_stored_procedure -v --tb=long -x' }} + EXTRA_PYTEST_ADDOPTS: ${{ inputs.pytest-addopts || '-v --tb=long' }} jobs: test: