-
Notifications
You must be signed in to change notification settings - Fork 148
SNOW-UD: Add inline UD test workflow and tox connector-swap support #4117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sfc-gh-fpawlowski
wants to merge
10
commits into
main
Choose a base branch
from
ud-ci-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 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 c006e1f
SNOW-UD: Temporarily enable pull_request trigger for UD workflow
sfc-gh-fpawlowski 941b1e1
SNOW-UD: Use shared install script for UD connector swap
sfc-gh-fpawlowski 20feb94
SNOW-UD: Fix tox_install_cmd.sh — integrate UD as first-priority branch
sfc-gh-fpawlowski 44cf53e
SNOW-UD: Add doctest step, default Python to 3.13
sfc-gh-fpawlowski 676f375
PULL REQUEST REMOVED
sfc-gh-fpawlowski e5e450b
Merge branch 'main' into ud-ci-workflow
sfc-gh-fpawlowski ca2ee23
Merge branch 'main' into ud-ci-workflow
sfc-gh-fpawlowski 95bec17
Merge branch 'main' into ud-ci-workflow
sfc-gh-fpawlowski a01f5d6
added pytest options override
sfc-gh-fpawlowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| 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.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' }} | ||
| EXTRA_PYTEST_ADDOPTS: ${{ inputs.pytest-addopts || '-v --tb=long' }} | ||
|
|
||
| jobs: | ||
| test: | ||
| 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: | ||
| - 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 \ | ||
|
Comment on lines
+83
to
+84
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a safer way to install these than |
||
| | 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 | ||
|
sfc-gh-joshi marked this conversation as resolved.
|
||
| 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" | ||
| GH_TOKEN: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} | ||
| 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 ${{ 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 ${{ env.EXTRA_PYTEST_ADDOPTS }} | ||
| TOX_PARALLEL_NO_SPINNER: 1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for
EXTRA_PYTEST_ADDOPTSis'-v --tb=long', not an empty string. This causes the conditionals at lines 99 and 109 (if: ${{ env.EXTRA_PYTEST_ADDOPTS == '' }}) to always evaluate to false when using default inputs, skipping the doctest and datasource tests unexpectedly.Impact: When the workflow is triggered without specifying
pytest-addopts, only integration tests run. Doctest and datasource tests are always skipped.Fix: Change the default to empty string:
Or update the conditionals to check for the specific default value, though an empty default is cleaner.
Spotted by Graphite

Is this helpful? React 👍 or 👎 to let us know.