|
37 | 37 | DEFAULT_PYTHON_VERSION = "3.14" |
38 | 38 |
|
39 | 39 | DEFAULT_MOCK_SERVER_TESTS_PYTHON_VERSION = "3.12" |
40 | | -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.14"] |
| 40 | +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.12"] |
41 | 41 |
|
42 | 42 | UNIT_TEST_PYTHON_VERSIONS: List[str] = [ |
43 | 43 | "3.9", |
@@ -656,6 +656,7 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): |
656 | 656 | system_test_path = os.path.join("tests", "system.py") |
657 | 657 | system_test_folder_path = os.path.join("tests", "system") |
658 | 658 |
|
| 659 | +<<<<<<< HEAD |
659 | 660 | if os.environ.get("SPANNER_EMULATOR_HOST"): |
660 | 661 | # Run tests against the emulator |
661 | 662 | run_system = True |
@@ -710,6 +711,41 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): |
710 | 711 |
|
711 | 712 | ======= |
712 | 713 | >>>>>>> d4bff6eaee2 (chore: improves logic within prerelease_deps session) |
| 714 | +======= |
| 715 | + # Only run system tests for one protobuf implementation on real Spanner to speed up the build. |
| 716 | + if os.environ.get("SPANNER_EMULATOR_HOST") or protobuf_implementation == "python": |
| 717 | + # Sanity check: Only run system tests if credentials or emulator are set. |
| 718 | + if os.environ.get("GOOGLE_APPLICATION_CREDENTIALS") or os.environ.get("SPANNER_EMULATOR_HOST"): |
| 719 | + # Only run system tests if found. |
| 720 | + if os.path.exists(system_test_path): |
| 721 | + session.run( |
| 722 | + "py.test", |
| 723 | + "--verbose", |
| 724 | + f"--junitxml=system_{session.python}_sponge_log.xml", |
| 725 | + system_test_path, |
| 726 | + *session.posargs, |
| 727 | + env={ |
| 728 | + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, |
| 729 | + "SPANNER_DATABASE_DIALECT": database_dialect, |
| 730 | + "SKIP_BACKUP_TESTS": "true", |
| 731 | + }, |
| 732 | + ) |
| 733 | + elif os.path.exists(system_test_folder_path): |
| 734 | + session.run( |
| 735 | + "py.test", |
| 736 | + "--verbose", |
| 737 | + f"--junitxml=system_{session.python}_sponge_log.xml", |
| 738 | + system_test_folder_path, |
| 739 | + *session.posargs, |
| 740 | + env={ |
| 741 | + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, |
| 742 | + "SPANNER_DATABASE_DIALECT": database_dialect, |
| 743 | + "SKIP_BACKUP_TESTS": "true", |
| 744 | + }, |
| 745 | + ) |
| 746 | + else: |
| 747 | + session.log("Skipping system tests because credentials/emulator are missing") |
| 748 | +>>>>>>> 3cda3a846be (chore: refine prerelease_deps to conditionally run system tests) |
713 | 749 |
|
714 | 750 | @nox.session(python=DEFAULT_PYTHON_VERSION) |
715 | 751 | def mypy(session): |
|
0 commit comments