Skip to content

Commit 93cf0dd

Browse files
committed
PYTHON-2102 Migrate testing to Windows 10
Add 32-bit Python testing on Windows.
1 parent e5ef8f4 commit 93cf0dd

File tree

2 files changed

+88
-104
lines changed

2 files changed

+88
-104
lines changed

.evergreen/config.yml

Lines changed: 80 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,24 +1298,6 @@ axes:
12981298
batchtime: 10080 # 7 days
12991299
variables:
13001300
libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/ubuntu1804-arm64/master/latest/libmongocrypt.tar.gz
1301-
- id: windows-vs2010
1302-
display_name: "Windows 64 Visual Studio 2010"
1303-
run_on: windows-64-vs2010-test
1304-
batchtime: 10080 # 7 days
1305-
variables:
1306-
libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/windows-test/master/latest/libmongocrypt.tar.gz
1307-
- id: windows-vs2015
1308-
display_name: "Windows 64 Visual Studio 2015"
1309-
run_on: windows-64-vs2015-test
1310-
batchtime: 10080 # 7 days
1311-
variables:
1312-
libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/windows-test/master/latest/libmongocrypt.tar.gz
1313-
- id: windows-vs2017
1314-
display_name: "Windows 64 Visual Studio 2017"
1315-
run_on: windows-64-vs2017-test
1316-
batchtime: 10080 # 7 days
1317-
variables:
1318-
libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/windows-test/master/latest/libmongocrypt.tar.gz
13191301
- id: windows-64-vsMulti-small
13201302
display_name: "Windows 64"
13211303
run_on: windows-64-vsMulti-small
@@ -1431,40 +1413,71 @@ axes:
14311413
batchtime: 10080 # 7 days
14321414
variables:
14331415
PYTHON_BINARY: "/opt/python/jython2.7/bin/jython"
1434-
# Windows
1435-
- id: "win-vs2010-3.4"
1436-
display_name: "Python 3.4"
1416+
# System python
1417+
- id: "system-python"
1418+
display_name: "Python"
14371419
variables:
1438-
PYTHON_BINARY: "C:/python/Python34/python.exe"
1439-
- id: "win-vs2015-2.7"
1420+
PYTHON_BINARY: "python"
1421+
- id: "system-python3"
1422+
display_name: "Python3"
1423+
variables:
1424+
PYTHON_BINARY: "python3"
1425+
1426+
- id: python-version-windows
1427+
display_name: "Python"
1428+
values:
1429+
- id: "2.7"
14401430
display_name: "Python 2.7"
14411431
variables:
14421432
PYTHON_BINARY: "C:/python/Python27/python.exe"
1443-
- id: "win-vs2015-3.5"
1433+
- id: "3.4"
1434+
display_name: "Python 3.4"
1435+
variables:
1436+
PYTHON_BINARY: "C:/python/Python34/python.exe"
1437+
- id: "3.5"
14441438
display_name: "Python 3.5"
14451439
variables:
14461440
PYTHON_BINARY: "C:/python/Python35/python.exe"
1447-
- id: "win-vs2015-3.6"
1441+
- id: "3.6"
14481442
display_name: "Python 3.6"
14491443
variables:
14501444
PYTHON_BINARY: "C:/python/Python36/python.exe"
1451-
- id: "win-vs2015-3.7"
1445+
- id: "3.7"
14521446
display_name: "Python 3.7"
14531447
variables:
14541448
PYTHON_BINARY: "C:/python/Python37/python.exe"
1455-
- id: "win-vs2015-3.8"
1449+
- id: "3.8"
14561450
display_name: "Python 3.8"
14571451
variables:
14581452
PYTHON_BINARY: "C:/python/Python38/python.exe"
1459-
# System python
1460-
- id: "system-python"
1461-
display_name: "Python"
1453+
1454+
- id: python-version-windows-32
1455+
display_name: "Python"
1456+
values:
1457+
- id: "2.7"
1458+
display_name: "32-bit Python 2.7"
14621459
variables:
1463-
PYTHON_BINARY: "python"
1464-
- id: "system-python3"
1465-
display_name: "Python3"
1460+
PYTHON_BINARY: "C:/python/32/Python27/python.exe"
1461+
- id: "3.4"
1462+
display_name: "32-bit Python 3.4"
14661463
variables:
1467-
PYTHON_BINARY: "python3"
1464+
PYTHON_BINARY: "C:/python/32/Python34/python.exe"
1465+
- id: "3.5"
1466+
display_name: "32-bit Python 3.5"
1467+
variables:
1468+
PYTHON_BINARY: "C:/python/32/Python35/python.exe"
1469+
- id: "3.6"
1470+
display_name: "32-bit Python 3.6"
1471+
variables:
1472+
PYTHON_BINARY: "C:/python/32/Python36/python.exe"
1473+
- id: "3.7"
1474+
display_name: "32-bit Python 3.7"
1475+
variables:
1476+
PYTHON_BINARY: "C:/python/32/Python37/python.exe"
1477+
- id: "3.8"
1478+
display_name: "32-bit Python 3.8"
1479+
variables:
1480+
PYTHON_BINARY: "C:/python/32/Python38/python.exe"
14681481

14691482
# Choice of mod_wsgi version
14701483
- id: mod-wsgi-version
@@ -1590,6 +1603,7 @@ buildvariants:
15901603
encryption: "*"
15911604
display_name: "Encryption ${platform} ${auth-ssl}"
15921605
tasks: &encryption-server-versions
1606+
- ".latest"
15931607
- ".4.2"
15941608
- ".4.0"
15951609
- ".2.6"
@@ -1805,10 +1819,10 @@ buildvariants:
18051819
- matrix_name: "tests-pyopenssl-windows"
18061820
matrix_spec:
18071821
platform: windows-64-vsMulti-small
1808-
python-version: ["win-vs2015-2.7", "win-vs2010-3.4", "win-vs2015-3.5", "win-vs2015-3.6", "win-vs2015-3.7", "win-vs2015-3.8"]
1822+
python-version-windows: "*"
18091823
auth: "*"
18101824
ssl: "ssl"
1811-
display_name: "PyOpenSSL ${platform} ${python-version} ${auth}"
1825+
display_name: "PyOpenSSL ${platform} ${python-version-windows} ${auth}"
18121826
tasks:
18131827
- "pyopenssl"
18141828

@@ -1910,14 +1924,14 @@ buildvariants:
19101924
display_name: "${green-framework} ${python-version} ${platform} ${auth-ssl}"
19111925
tasks: *all-server-versions
19121926

1913-
# Test CPython 3.4 against MongoDB 2.6-4.2 on Windows with Visual Studio 2010.
1914-
- matrix_name: "tests-windows-vs2010-python-version"
1927+
- matrix_name: "tests-windows-python-version"
19151928
matrix_spec:
1916-
platform: windows-vs2010
1917-
python-version: &win-vs2010-pythons ["win-vs2010-3.4"]
1929+
platform: windows-64-vsMulti-small
1930+
python-version-windows: "*"
19181931
auth-ssl: "*"
1919-
display_name: "${platform} ${python-version} ${auth-ssl}"
1932+
display_name: "${platform} ${python-version-windows} ${auth-ssl}"
19201933
tasks:
1934+
- ".latest"
19211935
- ".4.2"
19221936
- ".4.0"
19231937
- ".3.6"
@@ -1926,15 +1940,21 @@ buildvariants:
19261940
- ".3.0"
19271941
- ".2.6"
19281942

1929-
# windows-vs2010 3.4 is unable to dlopen the libmongocrypt ddl built on 2016
1930-
#- matrix_name: "tests-windows-vs2010-python-version-encryption"
1931-
# matrix_spec:
1932-
# platform: windows-vs2010
1933-
# python-version: *win-vs2010-pythons
1934-
# auth-ssl: "*"
1935-
# encryption: "*"
1936-
# display_name: "Encryption ${platform} ${python-version} ${auth-ssl}"
1937-
# tasks: *encryption-server-versions
1943+
- matrix_name: "tests-windows-python-version-32-bit"
1944+
matrix_spec:
1945+
platform: windows-64-vsMulti-small
1946+
python-version-windows-32: "*"
1947+
auth-ssl: "*"
1948+
display_name: "${platform} ${python-version-windows-32} ${auth-ssl}"
1949+
tasks:
1950+
- ".latest"
1951+
- ".4.2"
1952+
- ".4.0"
1953+
- ".3.6"
1954+
- ".3.4"
1955+
- ".3.2"
1956+
- ".3.0"
1957+
- ".2.6"
19381958

19391959
- matrix_name: "tests-python-version-requires-openssl-102-plus-test-ssl"
19401960
matrix_spec:
@@ -1968,42 +1988,15 @@ buildvariants:
19681988
tasks:
19691989
- ".latest"
19701990

1971-
# Test CPython 2.7, 3.5 and 3.6 against MongoDB 2.6-4.2
1972-
# on Windows with the Microsoft Visual C++ Compiler for Python 2.7 or Visual Studio 2015.
1973-
- matrix_name: "tests-windows-vs2015-python-version-27plus"
1974-
matrix_spec:
1975-
platform: windows-vs2015
1976-
python-version: &win-vs2015-pythons ["win-vs2015-2.7", "win-vs2015-3.5", "win-vs2015-3.6", "win-vs2015-3.7"]
1977-
auth-ssl: "*"
1978-
display_name: "${platform} ${python-version} ${auth-ssl}"
1979-
tasks:
1980-
- ".4.2"
1981-
- ".4.0"
1982-
- ".3.6"
1983-
- ".3.4"
1984-
- ".3.2"
1985-
- ".3.0"
1986-
- ".2.6"
1987-
1988-
- matrix_name: "tests-windows-vs2015-python-version-encryption"
1991+
- matrix_name: "tests-windows-encryption"
19891992
matrix_spec:
1990-
platform: windows-vs2015
1991-
python-version: *win-vs2015-pythons
1993+
platform: windows-64-vsMulti-small
1994+
python-version-windows: "*"
19921995
auth-ssl: "*"
19931996
encryption: "*"
1994-
display_name: "Encryption ${platform} ${python-version} ${auth-ssl}"
1997+
display_name: "Encryption ${platform} ${python-version-windows} ${auth-ssl}"
19951998
tasks: *encryption-server-versions
19961999

1997-
# Test CPython 3.7 against MongoDB >= 4.3 on Windows 2017+.
1998-
- matrix_name: "tests-windows-vs2017"
1999-
matrix_spec:
2000-
platform: windows-vs2017
2001-
python-version: ["win-vs2015-3.7"]
2002-
auth-ssl: "*"
2003-
display_name: "${platform} ${python-version} ${auth-ssl}"
2004-
tasks:
2005-
- .latest
2006-
20072000
# Storage engine tests on RHEL 6.2 (x86_64) with Python 2.7.
20082001
- matrix_name: "tests-storage-engines"
20092002
matrix_spec:
@@ -2075,21 +2068,12 @@ buildvariants:
20752068
tasks:
20762069
- name: "test-enterprise-auth"
20772070

2078-
- matrix_name: "tests-windows-vs2010-enterprise-auth"
2071+
- matrix_name: "tests-windows-enterprise-auth"
20792072
matrix_spec:
2080-
platform: windows-vs2010
2081-
python-version: *win-vs2010-pythons
2082-
auth: "auth"
2083-
display_name: "Enterprise ${auth} ${platform} ${python-version}"
2084-
tasks:
2085-
- name: "test-enterprise-auth"
2086-
2087-
- matrix_name: "tests-windows-vs2015-enterprise-auth"
2088-
matrix_spec:
2089-
platform: windows-vs2015
2090-
python-version: *win-vs2015-pythons
2073+
platform: windows-64-vsMulti-small
2074+
python-version-windows: "*"
20912075
auth: "auth"
2092-
display_name: "Enterprise ${auth} ${platform} ${python-version}"
2076+
display_name: "Enterprise ${auth} ${platform} ${python-version-windows}"
20932077
tasks:
20942078
- name: "test-enterprise-auth"
20952079

@@ -2189,8 +2173,8 @@ buildvariants:
21892173
- matrix_name: "aws-auth-test-windows"
21902174
matrix_spec:
21912175
platform: [windows-64-vsMulti-small]
2192-
python-version: ["win-vs2015-2.7", "win-vs2010-3.4", "win-vs2015-3.5", "win-vs2015-3.6", "win-vs2015-3.7", "win-vs2015-3.8"]
2193-
display_name: "MONGODB-AWS Auth ${platform} ${python-version}"
2176+
python-version-windows: "*"
2177+
display_name: "MONGODB-AWS Auth ${platform} ${python-version-windows}"
21942178
tasks:
21952179
- name: "aws-auth-test"
21962180

test/test_objectid.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,15 @@ def generate_objectid_with_timestamp(timestamp):
189189

190190
for tstamp, exp_datetime_args in TEST_DATA.items():
191191
oid = generate_objectid_with_timestamp(tstamp)
192-
if (not sys.platform.startswith("java") and
193-
tstamp > 0x7FFFFFFF and sys.maxsize < 2**32):
194-
# 32-bit platforms will overflow in datetime.fromtimestamp.
195-
with self.assertRaises((OverflowError, ValueError)):
192+
# 32-bit platforms may overflow in datetime.fromtimestamp.
193+
if tstamp > 0x7FFFFFFF and sys.maxsize < 2**32:
194+
try:
196195
oid.generation_time
197-
else:
198-
self.assertEqual(
199-
oid.generation_time,
200-
datetime.datetime(*exp_datetime_args, tzinfo=utc))
196+
except (OverflowError, ValueError):
197+
continue
198+
self.assertEqual(
199+
oid.generation_time,
200+
datetime.datetime(*exp_datetime_args, tzinfo=utc))
201201

202202
def test_random_regenerated_on_pid_change(self):
203203
# Test that change of pid triggers new random number generation.

0 commit comments

Comments
 (0)