Skip to content

Commit 19db90d

Browse files
committed
SNOW-1617614: asyncio network implementation, test set up (#2019)
1 parent 9f9c71e commit 19db90d

File tree

12 files changed

+2506
-4
lines changed

12 files changed

+2506
-4
lines changed

.github/workflows/build_test.yml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ on:
55
branches:
66
- master
77
- main
8+
- dev/aio-connector
89
tags:
910
- v*
1011
pull_request:
1112
branches:
1213
- master
1314
- main
1415
- prep-**
16+
- dev/aio-connector
1517
workflow_dispatch:
1618
inputs:
1719
logLevel:
@@ -332,10 +334,71 @@ jobs:
332334
.coverage.py${{ env.shortver }}-lambda-ci
333335
junit.py${{ env.shortver }}-lambda-ci-dev.xml
334336
337+
test-aio:
338+
name: Test asyncio ${{ matrix.os.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
339+
needs: build
340+
runs-on: ${{ matrix.os.image_name }}
341+
strategy:
342+
fail-fast: false
343+
matrix:
344+
os:
345+
- image_name: ubuntu-latest
346+
download_name: manylinux_x86_64
347+
- image_name: macos-latest
348+
download_name: macosx_x86_64
349+
- image_name: windows-2019
350+
download_name: win_amd64
351+
python-version: ["3.10", "3.11", "3.12"]
352+
cloud-provider: [aws, azure, gcp]
353+
steps:
354+
- uses: actions/checkout@v3
355+
- name: Set up Python
356+
uses: actions/setup-python@v4
357+
with:
358+
python-version: ${{ matrix.python-version }}
359+
- name: Display Python version
360+
run: python -c "import sys; print(sys.version)"
361+
- name: Setup parameters file
362+
shell: bash
363+
env:
364+
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
365+
run: |
366+
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
367+
.github/workflows/parameters/public/parameters_${{ matrix.cloud-provider }}.py.gpg > test/parameters.py
368+
- name: Download wheel(s)
369+
uses: actions/download-artifact@v3
370+
with:
371+
name: ${{ matrix.os.download_name }}_py${{ matrix.python-version }}
372+
path: dist
373+
- name: Show wheels downloaded
374+
run: ls -lh dist
375+
shell: bash
376+
- name: Upgrade setuptools, pip and wheel
377+
run: python -m pip install -U setuptools pip wheel
378+
- name: Install tox
379+
run: python -m pip install tox>=4
380+
- name: Run tests
381+
run: python -m tox run -e `echo py${PYTHON_VERSION/\./}-aio-ci`
382+
env:
383+
PYTHON_VERSION: ${{ matrix.python-version }}
384+
cloud_provider: ${{ matrix.cloud-provider }}
385+
PYTEST_ADDOPTS: --color=yes --tb=short
386+
TOX_PARALLEL_NO_SPINNER: 1
387+
shell: bash
388+
- name: Combine coverages
389+
run: python -m tox run -e coverage --skip-missing-interpreters false
390+
shell: bash
391+
- uses: actions/upload-artifact@v3
392+
with:
393+
name: coverage_aio_${{ matrix.os.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
394+
path: |
395+
.tox/.coverage
396+
.tox/coverage.xml
397+
335398
combine-coverage:
336399
if: ${{ success() || failure() }}
337400
name: Combine coverage
338-
needs: [lint, test, test-fips, test-lambda]
401+
needs: [lint, test, test-fips, test-lambda, test-aio]
339402
runs-on: ubuntu-latest
340403
steps:
341404
- uses: actions/checkout@v4

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ development =
9191
pytest-timeout
9292
pytest-xdist
9393
pytzdata
94+
pytest-asyncio
95+
aiohttp
9496
pandas =
9597
pandas>=1.0.0,<3.0.0
9698
pyarrow
9799
secure-local-storage =
98100
keyring>=23.1.0,<26.0.0
101+
aio =
102+
aiohttp
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
3+
#
4+
5+
from __future__ import annotations
6+
7+
from ._connection import SnowflakeConnection
8+
9+
__all__ = [SnowflakeConnection]

0 commit comments

Comments
 (0)