3434
3535DEFAULT_PYTHON_VERSION = "3.8"
3636
37- DEFAULT_MOCK_SERVER_TESTS_PYTHON_VERSION = "3.12"
3837UNIT_TEST_PYTHON_VERSIONS : List [str ] = [
3938 "3.7" ,
4039 "3.8" ,
@@ -169,30 +168,6 @@ def install_unittest_dependencies(session, *constraints):
169168 else :
170169 session .install ("-e" , "." , * constraints )
171170
172- # XXX Work around Kokoro image's older pip, which borks the OT install.
173- session .run ("pip" , "install" , "--upgrade" , "pip" )
174- constraints_path = str (
175- CURRENT_DIRECTORY / "testing" / f"constraints-{ session .python } .txt"
176- )
177- session .install ("-e" , ".[tracing]" , "-c" , constraints_path )
178- # XXX: Dump installed versions to debug OT issue
179- session .run ("pip" , "list" )
180-
181- # Run py.test against the unit tests with OpenTelemetry.
182- session .run (
183- "py.test" ,
184- "--quiet" ,
185- "--cov=google.cloud.spanner" ,
186- "--cov=google.cloud" ,
187- "--cov=tests.unit" ,
188- "--cov-append" ,
189- "--cov-config=.coveragerc" ,
190- "--cov-report=" ,
191- "--cov-fail-under=0" ,
192- os .path .join ("tests" , "unit" ),
193- * session .posargs ,
194- )
195-
196171
197172@nox .session (python = UNIT_TEST_PYTHON_VERSIONS )
198173@nox .parametrize (
@@ -235,34 +210,6 @@ def unit(session, protobuf_implementation):
235210 )
236211
237212
238- @nox .session (python = DEFAULT_MOCK_SERVER_TESTS_PYTHON_VERSION )
239- def mockserver (session ):
240- # Install all test dependencies, then install this package in-place.
241-
242- constraints_path = str (
243- CURRENT_DIRECTORY / "testing" / f"constraints-{ session .python } .txt"
244- )
245- # install_unittest_dependencies(session, "-c", constraints_path)
246- standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
247- session .install (* standard_deps , "-c" , constraints_path )
248- session .install ("-e" , "." , "-c" , constraints_path )
249-
250- # Run py.test against the mockserver tests.
251- session .run (
252- "py.test" ,
253- "--quiet" ,
254- f"--junitxml=unit_{ session .python } _sponge_log.xml" ,
255- "--cov=google" ,
256- "--cov=tests/unit" ,
257- "--cov-append" ,
258- "--cov-config=.coveragerc" ,
259- "--cov-report=" ,
260- "--cov-fail-under=0" ,
261- os .path .join ("tests" , "mockserver_tests" ),
262- * session .posargs ,
263- )
264-
265-
266213def install_systemtest_dependencies (session , * constraints ):
267214 # Use pre-release gRPC for system tests.
268215 # Exclude version 1.52.0rc1 which has a known issue.
@@ -294,18 +241,7 @@ def install_systemtest_dependencies(session, *constraints):
294241
295242
296243@nox .session (python = SYSTEM_TEST_PYTHON_VERSIONS )
297- @nox .parametrize (
298- "protobuf_implementation,database_dialect" ,
299- [
300- ("python" , "GOOGLE_STANDARD_SQL" ),
301- ("python" , "POSTGRESQL" ),
302- ("upb" , "GOOGLE_STANDARD_SQL" ),
303- ("upb" , "POSTGRESQL" ),
304- ("cpp" , "GOOGLE_STANDARD_SQL" ),
305- ("cpp" , "POSTGRESQL" ),
306- ],
307- )
308- def system (session , protobuf_implementation , database_dialect ):
244+ def system (session ):
309245 """Run the system test suite."""
310246 constraints_path = str (
311247 CURRENT_DIRECTORY / "testing" / f"constraints-{ session .python } .txt"
@@ -316,17 +252,6 @@ def system(session, protobuf_implementation, database_dialect):
316252 # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
317253 if os .environ .get ("RUN_SYSTEM_TESTS" , "true" ) == "false" :
318254 session .skip ("RUN_SYSTEM_TESTS is set to false, skipping" )
319- # Sanity check: Only run tests if the environment variable is set.
320- if not os .environ .get ("GOOGLE_APPLICATION_CREDENTIALS" , "" ) and not os .environ .get (
321- "SPANNER_EMULATOR_HOST" , ""
322- ):
323- session .skip (
324- "Credentials or emulator host must be set via environment variable"
325- )
326- # If POSTGRESQL tests and Emulator, skip the tests
327- if os .environ .get ("SPANNER_EMULATOR_HOST" ) and database_dialect == "POSTGRESQL" :
328- session .skip ("Postgresql is not supported by Emulator yet." )
329-
330255 # Install pyopenssl for mTLS testing.
331256 if os .environ .get ("GOOGLE_API_USE_CLIENT_CERTIFICATE" , "false" ) == "true" :
332257 session .install ("pyopenssl" )
@@ -339,12 +264,6 @@ def system(session, protobuf_implementation, database_dialect):
339264
340265 install_systemtest_dependencies (session , "-c" , constraints_path )
341266
342- # TODO(https://github.com/googleapis/synthtool/issues/1976):
343- # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
344- # The 'cpp' implementation requires Protobuf<4.
345- if protobuf_implementation == "cpp" :
346- session .install ("protobuf<4" )
347-
348267 # Run py.test against the system tests.
349268 if system_test_exists :
350269 session .run (
@@ -353,11 +272,6 @@ def system(session, protobuf_implementation, database_dialect):
353272 f"--junitxml=system_{ session .python } _sponge_log.xml" ,
354273 system_test_path ,
355274 * session .posargs ,
356- env = {
357- "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" : protobuf_implementation ,
358- "SPANNER_DATABASE_DIALECT" : database_dialect ,
359- "SKIP_BACKUP_TESTS" : "true" ,
360- },
361275 )
362276 if system_test_folder_exists :
363277 session .run (
@@ -366,11 +280,6 @@ def system(session, protobuf_implementation, database_dialect):
366280 f"--junitxml=system_{ session .python } _sponge_log.xml" ,
367281 system_test_folder_path ,
368282 * session .posargs ,
369- env = {
370- "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" : protobuf_implementation ,
371- "SPANNER_DATABASE_DIALECT" : database_dialect ,
372- "SKIP_BACKUP_TESTS" : "true" ,
373- },
374283 )
375284
376285
@@ -391,7 +300,7 @@ def cover(session):
391300def docs (session ):
392301 """Build the docs for this library."""
393302
394- session .install ("-e" , ".[tracing] " )
303+ session .install ("-e" , "." )
395304 session .install (
396305 # We need to pin to specific versions of the `sphinxcontrib-*` packages
397306 # which still support sphinx 4.x.
@@ -426,7 +335,7 @@ def docs(session):
426335def docfx (session ):
427336 """Build the docfx yaml files for this library."""
428337
429- session .install ("-e" , ".[tracing] " )
338+ session .install ("-e" , "." )
430339 session .install (
431340 # We need to pin to specific versions of the `sphinxcontrib-*` packages
432341 # which still support sphinx 4.x.
@@ -470,17 +379,10 @@ def docfx(session):
470379
471380@nox .session (python = "3.13" )
472381@nox .parametrize (
473- "protobuf_implementation,database_dialect" ,
474- [
475- ("python" , "GOOGLE_STANDARD_SQL" ),
476- ("python" , "POSTGRESQL" ),
477- ("upb" , "GOOGLE_STANDARD_SQL" ),
478- ("upb" , "POSTGRESQL" ),
479- ("cpp" , "GOOGLE_STANDARD_SQL" ),
480- ("cpp" , "POSTGRESQL" ),
481- ],
382+ "protobuf_implementation" ,
383+ ["python" , "upb" , "cpp" ],
482384)
483- def prerelease_deps (session , protobuf_implementation , database_dialect ):
385+ def prerelease_deps (session , protobuf_implementation ):
484386 """Run all tests with prerelease versions of dependencies installed."""
485387
486388 if protobuf_implementation == "cpp" and session .python in ("3.11" , "3.12" , "3.13" ):
@@ -553,8 +455,6 @@ def prerelease_deps(session, protobuf_implementation, database_dialect):
553455 "tests/unit" ,
554456 env = {
555457 "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" : protobuf_implementation ,
556- "SPANNER_DATABASE_DIALECT" : database_dialect ,
557- "SKIP_BACKUP_TESTS" : "true" ,
558458 },
559459 )
560460
@@ -571,8 +471,6 @@ def prerelease_deps(session, protobuf_implementation, database_dialect):
571471 * session .posargs ,
572472 env = {
573473 "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" : protobuf_implementation ,
574- "SPANNER_DATABASE_DIALECT" : database_dialect ,
575- "SKIP_BACKUP_TESTS" : "true" ,
576474 },
577475 )
578476 if os .path .exists (system_test_folder_path ):
@@ -584,7 +482,5 @@ def prerelease_deps(session, protobuf_implementation, database_dialect):
584482 * session .posargs ,
585483 env = {
586484 "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" : protobuf_implementation ,
587- "SPANNER_DATABASE_DIALECT" : database_dialect ,
588- "SKIP_BACKUP_TESTS" : "true" ,
589485 },
590486 )
0 commit comments