Commit 911561c
tests(spanner): update
This PR fixes 2 failing tests which appear in
#16762
In the system test presubmit `Kokoro System Tests`, the assertion is too
strict. Protobuf objects may fail equality (==) if one has extra
metadata populated by the server that the other lacks. If the server
fills in a default field in one response but not another, the assertion
fails even if the ID is identical. In addition, we need to cater for the
chance that other spanner instances are created while tests are running.
For example, in [one test
result](https://btx.cloud.google.com/invocations/946e7000-b177-491a-947a-88f2daf52a68/log)
we expected instance
`projects/precise-truck-742/instances/google-cloud-python-systest` but
found `projects/precise-truck-742/instances/multi-region-1776903230037`
```
=================================== FAILURES ===================================
_____________________________ test_list_instances ______________________________
..
def test_list_instances(
no_create_instance,
spanner_client,
existing_instances,
shared_instance,
):
instances = list(spanner_client.list_instances())
for instance in instances:
> assert instance in existing_instances or instance is shared_instance
...
tests/system/test_instance_api.py:40: AssertionError
```
The other failure only appears in the `Kokoro Pre-release Tests`.
Updating the `prerelease_deps` nox session to match the system test
session resolves the issue.
```
==================================== ERRORS ====================================
____________________ ERROR at setup of test_table_not_found ____________________
self =
def setup(self) -> None:
runner_fixture_id = f"_{self._loop_scope}_scoped_runner"
if runner_fixture_id not in self.fixturenames:
self.fixturenames.append(runner_fixture_id)
> return super().setup()
^^^^^^^^^^^^^^^
.nox/8f8a4a6e/lib/python3.14/site-packages/pytest_asyncio/plugin.py:458:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fixturedef =
request = >
@pytest.hookimpl(wrapper=True)
def pytest_fixture_setup(fixturedef: FixtureDef, request) -> object | None:
asyncio_mode = _get_asyncio_mode(request.config)
if not _is_asyncio_fixture_function(fixturedef.func):
if asyncio_mode == Mode.STRICT:
# Ignore async fixtures without explicit asyncio mark in strict mode
# This applies to pytest_trio fixtures, for example
> return (yield)
^^^^^
E pytest.PytestRemovedIn9Warning: '' requested an async fixture 'instance_configs', with no plugin or hook that handled it. This is usually an error, as pytest does not natively support it. This will turn into an error in pytest 9.
E See: https://docs.pytest.org/en/stable/deprecations.html#sync-test-depending-on-async-fixture
.nox/8f8a4a6e/lib/python3.14/site-packages/pytest_asyncio/plugin.py:728: PytestRemovedIn9Warning
```
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>prerelease_deps nox session to match system tests (#16764)1 parent 93ed424 commit 911561c
2 files changed
Lines changed: 90 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
658 | 664 | | |
659 | 665 | | |
660 | 666 | | |
| |||
675 | 681 | | |
676 | 682 | | |
677 | 683 | | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
696 | 755 | | |
697 | 756 | | |
698 | 757 | | |
| |||
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
41 | 52 | | |
42 | 53 | | |
43 | 54 | | |
| |||
0 commit comments