|
39 | 39 | DEFAULT_PYTHON_VERSION = "3.14" |
40 | 40 |
|
41 | 41 | DEFAULT_MOCK_SERVER_TESTS_PYTHON_VERSION = "3.12" |
42 | | -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.14"] |
| 42 | +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.12"] |
43 | 43 |
|
44 | 44 | UNIT_TEST_PYTHON_VERSIONS: List[str] = [ |
45 | 45 | "3.8", |
@@ -519,14 +519,6 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): |
519 | 519 | ): |
520 | 520 | session.skip("cpp implementation is not supported in python 3.11+") |
521 | 521 |
|
522 | | - # Sanity check: Only run tests if credentials or emulator are set. |
523 | | - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", "") and not os.environ.get( |
524 | | - "SPANNER_EMULATOR_HOST", "" |
525 | | - ): |
526 | | - session.skip( |
527 | | - "Credentials or emulator host must be set via environment variable" |
528 | | - ) |
529 | | - |
530 | 522 | # Install all dependencies |
531 | 523 | session.install("-e", ".[all, tests, tracing]") |
532 | 524 | unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES |
@@ -609,33 +601,37 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): |
609 | 601 |
|
610 | 602 | # Only run system tests for one protobuf implementation on real Spanner to speed up the build. |
611 | 603 | if os.environ.get("SPANNER_EMULATOR_HOST") or protobuf_implementation == "python": |
612 | | - # Only run system tests if found. |
613 | | - if os.path.exists(system_test_path): |
614 | | - session.run( |
615 | | - "py.test", |
616 | | - "--verbose", |
617 | | - f"--junitxml=system_{session.python}_sponge_log.xml", |
618 | | - system_test_path, |
619 | | - *session.posargs, |
620 | | - env={ |
621 | | - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, |
622 | | - "SPANNER_DATABASE_DIALECT": database_dialect, |
623 | | - "SKIP_BACKUP_TESTS": "true", |
624 | | - }, |
625 | | - ) |
626 | | - elif os.path.exists(system_test_folder_path): |
627 | | - session.run( |
628 | | - "py.test", |
629 | | - "--verbose", |
630 | | - f"--junitxml=system_{session.python}_sponge_log.xml", |
631 | | - system_test_folder_path, |
632 | | - *session.posargs, |
633 | | - env={ |
634 | | - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, |
635 | | - "SPANNER_DATABASE_DIALECT": database_dialect, |
636 | | - "SKIP_BACKUP_TESTS": "true", |
637 | | - }, |
638 | | - ) |
| 604 | + # Sanity check: Only run system tests if credentials or emulator are set. |
| 605 | + if os.environ.get("GOOGLE_APPLICATION_CREDENTIALS") or os.environ.get("SPANNER_EMULATOR_HOST"): |
| 606 | + # Only run system tests if found. |
| 607 | + if os.path.exists(system_test_path): |
| 608 | + session.run( |
| 609 | + "py.test", |
| 610 | + "--verbose", |
| 611 | + f"--junitxml=system_{session.python}_sponge_log.xml", |
| 612 | + system_test_path, |
| 613 | + *session.posargs, |
| 614 | + env={ |
| 615 | + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, |
| 616 | + "SPANNER_DATABASE_DIALECT": database_dialect, |
| 617 | + "SKIP_BACKUP_TESTS": "true", |
| 618 | + }, |
| 619 | + ) |
| 620 | + elif os.path.exists(system_test_folder_path): |
| 621 | + session.run( |
| 622 | + "py.test", |
| 623 | + "--verbose", |
| 624 | + f"--junitxml=system_{session.python}_sponge_log.xml", |
| 625 | + system_test_folder_path, |
| 626 | + *session.posargs, |
| 627 | + env={ |
| 628 | + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, |
| 629 | + "SPANNER_DATABASE_DIALECT": database_dialect, |
| 630 | + "SKIP_BACKUP_TESTS": "true", |
| 631 | + }, |
| 632 | + ) |
| 633 | + else: |
| 634 | + session.log("Skipping system tests because credentials/emulator are missing") |
639 | 635 |
|
640 | 636 | @nox.session(python=DEFAULT_PYTHON_VERSION) |
641 | 637 | def mypy(session): |
|
0 commit comments