test(clients): registry live reads use the global location; record live registry findings

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 08:48:29 +01:00
co-authored by Claude Sonnet 5.5
parent 438e737ffb
commit 89f556e187
2 changed files with 14 additions and 3 deletions
+2
View File
@@ -218,6 +218,8 @@ Neither discovery nor the docs state these; each is a choice made here:
- `iam.v2.policies.update` (PUT) needs the policy `etag`: `update_deny_policy` reads it first. Whether IAM accepts an empty etag is unread.
- `searchPolicyBindings` (iam v3) is listed under key `policyBindings` from the response schema; no live reply was seen (organization scope, no org access).
Agent Registry location (2026-10-25, project `lisa-448004`, service-account token, after the API was enabled): the registry is global. `v1/agents`, `v1/mcpServers` and `v1alpha/skills`, `v1alpha/publishers` answer 200 on `locations/global` (mcpServers about 200 KB, skills 130 KB per page of 100, skills paginates). On `locations/us-central1`, `v1/agents` and `v1/mcpServers` answer 200 but empty, while `v1alpha/skills` and `v1alpha/publishers` answer 503 UNAVAILABLE after about a minute. The live tests therefore use `global`; a caller with `GOOGLE_CLOUD_LOCATION=us-central1` must build the registry with `location = "global"`.
## Gaps
- The three APIs above are not enabled on the test project, so no response
@@ -36,6 +36,15 @@ bool live_ready(const char* test) {
}
bool have_oauth() { return Credentials::has_oauth(); }
// The registry is global: skills and publishers answer 503 UNAVAILABLE on a
// regional location such as us-central1 (checked live), so registry reads use
// "global" whatever GOOGLE_CLOUD_LOCATION says.
CloudContext registry_context() {
CloudContext c = CloudContext::from_env();
c.location = "global";
return c;
}
// With OAuth the call must work, or answer 403 SERVICE_DISABLED (the API is
// not enabled on the project: the path and auth were accepted, enabling an
// API is a human decision this test never makes). With a key only, 401
@@ -82,7 +91,7 @@ TEST(registry_live, audit_trail_read_needs_oauth) {
TEST(registry_live, registry_reads) {
if (!live_ready("registry_live.registry_reads")) return;
AgentRegistry reg(GoogleClient::from_env(), CloudContext::from_env());
AgentRegistry reg(GoogleClient::from_env(), registry_context());
for (AssetKind k : {AssetKind::kServices, AssetKind::kAgents, AssetKind::kMcpServers,
AssetKind::kEndpoints, AssetKind::kBindings, AssetKind::kSkills,
AssetKind::kPublishers})
@@ -94,13 +103,13 @@ TEST(registry_live, registry_reads) {
// answers 200 once its API is enabled; a disabled API is reported loudly.
TEST(registry_live, v1alpha_operations_and_deny_policy_reads) {
if (!live_ready("registry_live.v1alpha_operations_and_deny_policy_reads")) return;
AgentRegistry alpha(GoogleClient::from_env(), CloudContext::from_env(),
AgentRegistry alpha(GoogleClient::from_env(), registry_context(),
RegistryVersion::kV1Alpha);
ASSERT_EQ(alpha.version(), std::string("v1alpha"));
for (AssetKind k : {AssetKind::kServices, AssetKind::kAgents, AssetKind::kMcpServers,
AssetKind::kEndpoints, AssetKind::kBindings, AssetKind::kAiApplications})
expect_read([&] { alpha.list(k); });
AgentRegistry reg(GoogleClient::from_env(), CloudContext::from_env());
AgentRegistry reg(GoogleClient::from_env(), registry_context());
expect_read([&] { reg.operations(); });
AgentGateway gw(GoogleClient::from_env(), CloudContext::from_env());
expect_read([&] { gw.operations(); });