googleapis / googleapis/google-cloud-python
System test `test_iam_policy` fails with `PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python`
- 主要语言
- Python
- 星标
- 5.4k
- 派生
- 1.8k
- 平均合并
- 3 天 4 小时
- 30 天内合并 PR
- 122
描述
See the presubmit failure `Kokoro Prerelease Dependencies` in PR https://github.com/googleapis/python-spanner/pull/1156 where the system test `test_iam_policy` fails when using `PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python`.
To reproduce the issue, install this library using `pip install .` and run `PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python pytest tests/system/test_writer.py::test_append_rows_with_proto3`
```
=================================== FAILURES ===================================
_______________________________ test_iam_policy ________________________________
not_emulator = None
shared_instance =
databases_to_delete = []
def test_iam_policy(
not_emulator,
shared_instance,
databases_to_delete,
):
pool = spanner_v1.BurstyPool(labels={"testcase": "iam_policy"})
temp_db_id = _helpers.unique_id("iam_db", separator="_")
create_table = (
"CREATE TABLE policy (\n"
+ " Id STRING(36) NOT NULL,\n"
+ " Field1 STRING(36) NOT NULL\n"
+ ") PRIMARY KEY (Id)"
)
create_role = "CREATE ROLE parent"
temp_db = shared_instance.database(
temp_db_id,
ddl_statements=[create_table, create_role],
pool=pool,
)
create_op = temp_db.create()
databases_to_delete.append(temp_db)
create_op.result(DBAPI_OPERATION_TIMEOUT)
policy = temp_db.get_iam_policy(3)
assert policy.version == 0
assert policy.etag == b"\x00 \x01"
new_binding = policy_pb2.Binding(
role="",
members=[""],
condition=expr_pb2.Expr(
title="condition title",
expression='resource.name.endsWith("/databaseRoles/parent")',
),
)
policy.version = 3
policy.bindings.append(new_binding)
temp_db.set_iam_policy(policy)
new_policy = temp_db.get_iam_policy(3)
assert new_policy.version == 3
> assert new_policy.bindings == [new_binding]
tests/system/test_database_api.py:297:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [role:
members:
condition {
expression: "resource.name.endsWith(\"/databaseRoles/parent\")"
title: "condition title"
}
]
other = [role:
members:
condition {
expression: "resource.name.endsWith(\"/databaseRoles/parent\")"
title: "condition title"
}
]
def __eq__(self, other: Any) -> bool:
"""Compares the current instance with another one."""
if self is other:
return True
if not isinstance(other, self.__class__):
> raise TypeError('Can only compare repeated composite fields against '
'other repeated composite fields.')
E TypeError: Can only compare repeated composite fields against other repeated composite fields.
.nox/8f8a4a6e/lib/python3.12/site-packages/google/protobuf/internal/containers.py:328: TypeError
=============================== warnings summary ===============================
```
贡献指南
评估
这个 Issue 还没有评估数据。