Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2a3d0c3
SNOW-UD: Add inline UD test workflow with isolated tox environments
sfc-gh-fpawlowski Mar 12, 2026
c006e1f
SNOW-UD: Temporarily enable pull_request trigger for UD workflow
sfc-gh-fpawlowski Mar 12, 2026
941b1e1
SNOW-UD: Use shared install script for UD connector swap
sfc-gh-fpawlowski Mar 12, 2026
20feb94
SNOW-UD: Fix tox_install_cmd.sh — integrate UD as first-priority branch
sfc-gh-fpawlowski Mar 12, 2026
44cf53e
SNOW-UD: Add doctest step, default Python to 3.13
sfc-gh-fpawlowski Mar 13, 2026
676f375
PULL REQUEST REMOVED
sfc-gh-fpawlowski Mar 13, 2026
e5e450b
Merge branch 'main' into ud-ci-workflow
sfc-gh-fpawlowski Mar 13, 2026
ca2ee23
Merge branch 'main' into ud-ci-workflow
sfc-gh-fpawlowski Mar 22, 2026
95bec17
Merge branch 'main' into ud-ci-workflow
sfc-gh-fpawlowski Apr 22, 2026
566d80f
Revert "PULL REQUEST REMOVED"
sfc-gh-fpawlowski Apr 22, 2026
3f2c666
Add pytest-addopts input to UD inline tests workflow
sfc-gh-fpawlowski Apr 22, 2026
ab4b935
Temporarily limit UD tests to test_stored_procedure.py
sfc-gh-fpawlowski Apr 22, 2026
eb4091b
Fix UD test filter to apply on PR triggers too
sfc-gh-fpawlowski Apr 22, 2026
8ece0a6
Fix UD test filter to use -k instead of file path
sfc-gh-fpawlowski Apr 22, 2026
bba3ae5
Run full UD test suite with verbose output
sfc-gh-fpawlowski Apr 22, 2026
7563b04
test splitting tests into groups
sfc-gh-pczajka May 8, 2026
d746b9c
revert doctests
sfc-gh-pczajka May 8, 2026
32defa2
Merge branch 'main' into ud-ci-workflow-auto-triggered-full
sfc-gh-fpawlowski Jun 26, 2026
0b8da62
Point UD install URL at renamed snowflakedb/drivers repo
sfc-gh-pczajka Aug 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 151 additions & 0 deletions .github/workflows/ud-inline-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
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:
description: 'Branch of universal-driver repo to use'
required: false
default: 'snowpark-compatibility'
type: string
python-version:
description: 'Python version'
required: false
default: '3.13'
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'
pytest-addopts:
description: 'Extra pytest args, e.g. "-k test_dataframe" or "--maxfail=5"'
required: false
default: ''
type: string

permissions:
contents: read

env:
PYTHON_VERSION: ${{ inputs.python-version || '3.13' }}
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 || '-v --tb=long' }}

jobs:
test:
strategy:
fail-fast: false
matrix:
group: [integration, scala]
name: "${{ matrix.group }} py${{ inputs.python-version || '3.13' }}-${{ inputs.cloud-provider || 'aws' }}"
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: Run tests
id: tests
run: |
set +e
if [ "${{ matrix.group }}" = "integration" ]; then
python -m tox -e "py${PYTHON_VERSION//.}-notdoctest-ci" \
-- --ignore=tests/integ/scala 2>&1 | tee test-output.log
elif [ "${{ matrix.group }}" = "scala" ]; then
python -m tox -e "py${PYTHON_VERSION//.}-notdoctest-ci" \
-- -k scala 2>&1 | tee test-output.log
fi
grep -oP '[\d]+ (failed|passed|skipped|warnings?|errors?)' test-output.log > results.txt || true
cat results.txt
env:
cloud_provider: ${{ env.CLOUD_PROVIDER }}
ud_connector_path: "git+https://github.com/snowflakedb/drivers@${{ env.UD_BRANCH }}#subdirectory=python"
GH_TOKEN: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }}
PYTEST_ADDOPTS: --color=yes --tb=short ${{ env.EXTRA_PYTEST_ADDOPTS }}
TOX_PARALLEL_NO_SPINNER: 1

- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: results-${{ matrix.group }}
path: results.txt

summary:
if: always()
needs: test
runs-on: ubuntu-latest
steps:
- name: Download all results
uses: actions/download-artifact@v4
with:
pattern: results-*

- name: Generate summary
run: |
python3 - <<'SCRIPT'
import glob, re, collections, os

totals = collections.Counter()
for path in sorted(glob.glob("results-*/results.txt")):
with open(path) as f:
for line in f:
line = line.strip()
m = re.match(r"(\d+)\s+(\w+)", line)
if m:
totals[m.group(2)] += int(m.group(1))

parts = []
for key in ["failed", "passed", "skipped", "warnings", "errors"]:
if totals.get(key, 0) > 0:
parts.append(f"{totals[key]} {key}")

line = ", ".join(parts)
print(f"Total: {line}")
with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as f:
f.write(f"## Test Results\n\n`{line}`\n")

if totals.get("failed", 0) > 0 or totals.get("errors", 0) > 0:
exit(1)
SCRIPT
19 changes: 15 additions & 4 deletions scripts/tox_install_cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +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[@]}
else
echo "Using Python Connector from PyPI"
uv pip install ${uv_options[@]}
fi
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,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
Expand Down
Loading