diff --git a/ci/container/test_authentication.sh b/ci/container/test_authentication.sh index 18bd6e492a..9b41d422b5 100755 --- a/ci/container/test_authentication.sh +++ b/ci/container/test_authentication.sh @@ -17,6 +17,9 @@ export RUN_AUTH_TESTS=true export AUTHENTICATION_TESTS_ENV="docker" export PYTHONPATH=$SOURCE_ROOT -python3 -m pip install --break-system-packages -e . +python3 -m pip install --break-system-packages -e ".[develompent]" -python3 -m pytest test/auth/* +python3 -m pytest test/auth/* -m "not aio" + +python3 -m pip install --break-system-packages -e ".[aio, aioboto]" +python3 -m pytest test/auth/* -m "aio" diff --git a/ci/test_darwin.sh b/ci/test_darwin.sh index bab039f73f..8c97627522 100755 --- a/ci/test_darwin.sh +++ b/ci/test_darwin.sh @@ -34,7 +34,7 @@ for PYTHON_VERSION in ${PYTHON_VERSIONS}; do SHORT_VERSION=$(python3 -c "print('${PYTHON_VERSION}'.replace('.', ''))") CONNECTOR_WHL=$(ls ${CONNECTOR_DIR}/dist/snowflake_connector_python*cp${SHORT_VERSION}*.whl) # pandas not tested here because of macos issue: SNOW-1660226 - TEST_ENVLIST=$(python3 -c "print('fix_lint,' + ','.join('py${SHORT_VERSION}-' + e + '-ci' for e in ['unit','integ','sso']) + ',py${SHORT_VERSION}-coverage')") + TEST_ENVLIST=$(python3 -c "print('fix_lint,' + ','.join('py${SHORT_VERSION}-' + e + '-ci' for e in ['unit','integ','sso','aio']) + ',py${SHORT_VERSION}-coverage')") echo "[Info] Running tox for ${TEST_ENVLIST}" python3.12 -m tox run -e ${TEST_ENVLIST} --installpkg ${CONNECTOR_WHL} done diff --git a/ci/test_fips.sh b/ci/test_fips.sh index 5b1ec70514..0a339daa36 100755 --- a/ci/test_fips.sh +++ b/ci/test_fips.sh @@ -18,7 +18,7 @@ pip install -U setuptools pip # Install pytest-xdist for parallel execution pip install pytest-xdist -pip install "${CONNECTOR_WHL}[pandas,secure-local-storage,development]" +pip install "${CONNECTOR_WHL}[pandas,secure-local-storage,development,aio,aioboto]" echo "!!! Environment description !!!" echo "Default installed OpenSSL version" @@ -29,7 +29,10 @@ pip freeze cd $CONNECTOR_DIR -# Run tests in parallel using pytest-xdist -pytest -n auto -vvv --cov=snowflake.connector --cov-report=xml:coverage.xml test --ignore=test/integ/aio_it --ignore=test/unit/aio --ignore=test/wif/test_wif_async.py +# Run tests in parallel using pytest-xdist (including aio tests) +pytest -n auto -vvv --cov=snowflake.connector --cov-report=xml:coverage.xml -m "not aio" test --ignore=test/integ/aio_it --ignore=test/unit/aio --ignore=test/wif/test_wif_async.py +# Run aio tests separately +pytest -n auto -vvv --cov=snowflake.connector --cov-append --cov-report=xml:coverage.xml -m "aio and unit" test +pytest -n auto -vvv --cov=snowflake.connector --cov-append --cov-report=xml:coverage.xml -m "aio and integ" test deactivate diff --git a/ci/test_linux.sh b/ci/test_linux.sh index baae94425f..dc0bc824b3 100755 --- a/ci/test_linux.sh +++ b/ci/test_linux.sh @@ -40,7 +40,7 @@ else echo "[Info] Testing with ${PYTHON_VERSION}" SHORT_VERSION=$(python3.10 -c "print('${PYTHON_VERSION}'.replace('.', ''))") CONNECTOR_WHL=$(ls $CONNECTOR_DIR/dist/snowflake_connector_python*cp${SHORT_VERSION}*manylinux2014*.whl | sort -r | head -n 1) - TEST_LIST=`echo py${PYTHON_VERSION/\./}-{unit-parallel,integ,pandas-parallel,sso}-ci | sed 's/ /,/g'` + TEST_LIST=`echo py${PYTHON_VERSION/\./}-{unit-parallel,integ,pandas-parallel,sso,aio}-ci | sed 's/ /,/g'` TEST_ENVLIST=fix_lint,$TEST_LIST,py${PYTHON_VERSION/\./}-coverage echo "[Info] Running tox for ${TEST_ENVLIST}" diff --git a/ci/test_windows.bat b/ci/test_windows.bat index ed6d8fa496..bd10037c3e 100644 --- a/ci/test_windows.bat +++ b/ci/test_windows.bat @@ -47,7 +47,7 @@ curl https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/3.11.0/wire set JUNIT_REPORT_DIR=%workspace% set COV_REPORT_DIR=%workspace% -set TEST_ENVLIST=fix_lint,py%pv%-unit-ci,py%pv%-integ-ci,py%pv%-pandas-ci,py%pv%-sso-ci,py%pv%-coverage +set TEST_ENVLIST=fix_lint,py%pv%-unit-ci,py%pv%-integ-ci,py%pv%-pandas-ci,py%pv%-sso-ci,py%pv%-aio-ci,py%pv%-coverage tox -e %TEST_ENVLIST% --installpkg %connector_whl% if %errorlevel% neq 0 goto :error diff --git a/tox.ini b/tox.ini index fa62839924..ab687ecd12 100644 --- a/tox.ini +++ b/tox.ini @@ -122,6 +122,22 @@ commands = {env:SNOWFLAKE_PYTEST_CMD} -n auto -m "aio and unit" -vvv {posargs:} test {env:SNOWFLAKE_PYTEST_CMD} -n auto -m "aio and integ" -vvv {posargs:} test +[testenv:py{39,310,311,312,313}-aio] +description = Run aio tests for {basepython} +extras= + development + aio + aioboto + pandas + secure-local-storage +setenv = + {[testenv]setenv} + SNOWFLAKE_TEST_TYPE = unit +passenv = {[testenv]passenv} +commands = + {env:SNOWFLAKE_PYTEST_CMD} -n auto -m "aio and unit" -vvv {posargs:} test + {env:SNOWFLAKE_PYTEST_CMD} -n auto -m "aio and integ" -vvv {posargs:} test + [testenv:aio-unsupported-python] description = Run aio connector on unsupported python versions extras=