feat(cli): add otel_to_cloud flag to adk deploy agent_engine command

Co-authored-by: Wiktoria Walczak <wwalczak@google.com>
PiperOrigin-RevId: 858546581
This commit is contained in:
Wiktoria Walczak
2026-01-20 05:41:39 -08:00
committed by Copybara-Service
parent 69ad605bc4
commit 21f63f66ee
3 changed files with 53 additions and 0 deletions
@@ -410,6 +410,38 @@ def test_cli_deploy_agent_engine_success(
assert called_kwargs.get("region") == "us-central1"
# cli deploy agent_engine with --otel_to_cloud
def test_cli_deploy_agent_engine_otel_to_cloud_success(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
"""Successful path should call cli_deploy.to_agent_engine with --otel_to_cloud."""
rec = _Recorder()
monkeypatch.setattr(cli_tools_click.cli_deploy, "to_agent_engine", rec)
agent_dir = tmp_path / "agent_ae"
agent_dir.mkdir()
runner = CliRunner()
result = runner.invoke(
cli_tools_click.main,
[
"deploy",
"agent_engine",
"--project",
"test-proj",
"--region",
"us-central1",
"--otel_to_cloud",
str(agent_dir),
],
)
assert result.exit_code == 0
assert rec.calls, "cli_deploy.to_agent_engine must be invoked"
called_kwargs = rec.calls[0][1]
assert called_kwargs.get("project") == "test-proj"
assert called_kwargs.get("region") == "us-central1"
assert called_kwargs.get("otel_to_cloud")
# cli deploy gke
def test_cli_deploy_gke_success(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch