|
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", |
@@ -566,14 +566,6 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): |
566 | 566 | ): |
567 | 567 | session.skip("cpp implementation is not supported in python 3.11+") |
568 | 568 |
|
569 | | - # Sanity check: Only run tests if credentials or emulator are set. |
570 | | - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", "") and not os.environ.get( |
571 | | - "SPANNER_EMULATOR_HOST", "" |
572 | | - ): |
573 | | - session.skip( |
574 | | - "Credentials or emulator host must be set via environment variable" |
575 | | - ) |
576 | | - |
577 | 569 | # Install all dependencies |
578 | 570 | session.install("-e", ".[all, tests, tracing]") |
579 | 571 | unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES |
@@ -656,37 +648,37 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): |
656 | 648 |
|
657 | 649 | # Only run system tests for one protobuf implementation on real Spanner to speed up the build. |
658 | 650 | if os.environ.get("SPANNER_EMULATOR_HOST") or protobuf_implementation == "python": |
659 | | - # Only run system tests if found. |
660 | | - if os.path.exists(system_test_path): |
661 | | - session.run( |
662 | | - "py.test", |
663 | | - "--verbose", |
664 | | - "-o", |
665 | | - "asyncio_mode=auto", |
666 | | - f"--junitxml=system_{session.python}_sponge_log.xml", |
667 | | - system_test_path, |
668 | | - *session.posargs, |
669 | | - env={ |
670 | | - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, |
671 | | - "SPANNER_DATABASE_DIALECT": database_dialect, |
672 | | - "SKIP_BACKUP_TESTS": "true", |
673 | | - }, |
674 | | - ) |
675 | | - elif os.path.exists(system_test_folder_path): |
676 | | - session.run( |
677 | | - "py.test", |
678 | | - "--verbose", |
679 | | - "-o", |
680 | | - "asyncio_mode=auto", |
681 | | - f"--junitxml=system_{session.python}_sponge_log.xml", |
682 | | - system_test_folder_path, |
683 | | - *session.posargs, |
684 | | - env={ |
685 | | - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, |
686 | | - "SPANNER_DATABASE_DIALECT": database_dialect, |
687 | | - "SKIP_BACKUP_TESTS": "true", |
688 | | - }, |
689 | | - ) |
| 651 | + # Sanity check: Only run system tests if credentials or emulator are set. |
| 652 | + if os.environ.get("GOOGLE_APPLICATION_CREDENTIALS") or os.environ.get("SPANNER_EMULATOR_HOST"): |
| 653 | + # Only run system tests if found. |
| 654 | + if os.path.exists(system_test_path): |
| 655 | + session.run( |
| 656 | + "py.test", |
| 657 | + "--verbose", |
| 658 | + f"--junitxml=system_{session.python}_sponge_log.xml", |
| 659 | + system_test_path, |
| 660 | + *session.posargs, |
| 661 | + env={ |
| 662 | + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, |
| 663 | + "SPANNER_DATABASE_DIALECT": database_dialect, |
| 664 | + "SKIP_BACKUP_TESTS": "true", |
| 665 | + }, |
| 666 | + ) |
| 667 | + elif os.path.exists(system_test_folder_path): |
| 668 | + session.run( |
| 669 | + "py.test", |
| 670 | + "--verbose", |
| 671 | + f"--junitxml=system_{session.python}_sponge_log.xml", |
| 672 | + system_test_folder_path, |
| 673 | + *session.posargs, |
| 674 | + env={ |
| 675 | + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, |
| 676 | + "SPANNER_DATABASE_DIALECT": database_dialect, |
| 677 | + "SKIP_BACKUP_TESTS": "true", |
| 678 | + }, |
| 679 | + ) |
| 680 | + else: |
| 681 | + session.log("Skipping system tests because credentials/emulator are missing") |
690 | 682 |
|
691 | 683 | @nox.session(python=DEFAULT_PYTHON_VERSION) |
692 | 684 | def mypy(session): |
|
0 commit comments