Skip to content

Commit 7d92c1e

Browse files
SNOW-267170 fix pr-head and test running script bug (#607)
1 parent db054fd commit 7d92c1e

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

ci/test_linux.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ mv ${CONNECTOR_DIR}/test/parameters_jenkins.py ${CONNECTOR_DIR}/test/parameters.
2828

2929
# Run tests
3030
cd $CONNECTOR_DIR
31-
if [[ -z "$is_old_driver" ]]; then
31+
if [[ "$is_old_driver" == "true" ]]; then
32+
# Old Driver Test
33+
echo "[Info] Running old connector tests"
34+
python3 -m tox -e olddriver
35+
else
3236
for PYTHON_VERSION in ${PYTHON_VERSIONS}; do
3337
echo "[Info] Testing with ${PYTHON_VERSION}"
3438
SHORT_VERSION=$(python3 -c "print('${PYTHON_VERSION}'.replace('.', ''))")
3539
CONNECTOR_WHL=$(ls $CONNECTOR_DIR/dist/snowflake_connector_python*cp${SHORT_VERSION}*manylinux2010*.whl | sort -r | head -n 1)
36-
TEST_ENVLIST=fix_lint,py${SHORT_VERSION}-{extras,unit,integ,pandas,sso}-ci,coverage
40+
TEST_ENVLIST=fix_lint,py${SHORT_VERSION}-{extras,unit,integ,pandas,sso}-ci,py${SHORT_VERSION}-coverage
3741
echo "[Info] Running tox for ${TEST_ENVLIST}"
3842

3943
python3 -m tox -e ${TEST_ENVLIST} --external_wheels ${CONNECTOR_WHL}
4044
done
41-
else
42-
# Old Driver Test
43-
echo "[Info] Running old connector tests"
44-
python3 -m tox -e olddriver
4545
fi

test/integ/test_key_pair_authentication.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import snowflake.connector
1515

1616

17+
@pytest.mark.skipolddriver
1718
def test_different_key_length(is_public_test, request, conn_cnx, db_parameters):
1819
if is_public_test:
1920
pytest.skip('This test requires ACCOUNTADMIN privilege to set the public key')
@@ -63,6 +64,7 @@ def fin():
6364
pass
6465

6566

67+
@pytest.mark.skipolddriver
6668
def test_multiple_key_pair(is_public_test, request, conn_cnx, db_parameters):
6769
if is_public_test:
6870
pytest.skip('This test requires ACCOUNTADMIN privilege to set the public key')

tox.ini

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ commands =
9494
{env:SNOWFLAKE_PYTEST_CMD} -m "not skipolddriver" -vvv {posargs:} test
9595

9696
[testenv:coverage]
97-
description = [run locally after tests]: combine coverage data and create report;
97+
description = [run locally after tests]: combine coverage data and create report
9898
; generates a diff coverage against origin/master (can be changed by setting DIFF_AGAINST env var)
9999
deps = {[testenv]deps}
100100
coverage
@@ -109,6 +109,16 @@ commands = coverage combine
109109
; diff-cover --compare-branch {env:DIFF_AGAINST:origin/master} {toxworkdir}/coverage.xml
110110
depends = py35, py36, py37, py38
111111

112+
[testenv:py{36,37,38}-coverage]
113+
# I hate doing this, but this env is for Jenkins, please keep it up-to-date with the one env above it if necessary
114+
description = [run locally after tests]: combine coverage data and create report specifically with {basepython}
115+
deps = {[testenv:coverage]deps}
116+
skip_install = {[testenv:coverage]skip_install}
117+
passenv = {[testenv:coverage]passenv}
118+
setenv = {[testenv:coverage]setenv}
119+
commands = {[testenv:coverage]commands}
120+
depends = {[testenv:coverage]depends}
121+
112122
[testenv:flake8]
113123
; DEPRECATED
114124
description = check code style with flake8
@@ -118,6 +128,7 @@ commands = flake8 {posargs}
118128

119129
[testenv:fix_lint]
120130
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
131+
basepython = python3.6
121132
passenv =
122133
PROGRAMDATA
123134
deps =

0 commit comments

Comments
 (0)