Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ lint:

.PHONY: test
test: update generate-test-certs
uv run pytest ./packages/**/tests/
uv run pytest ./packages/**/tests/ ./samples/adk/basic/tests/

.PHONY: build
build: update format
Expand Down
2 changes: 1 addition & 1 deletion python/samples/adk/basic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ COPY uv.lock uv.lock

RUN uv sync --locked --refresh

CMD ["basic"]
CMD ["kagent-adk", "run", "basic", "--working-dir", "/app", "--host", "0.0.0.0"]
20 changes: 20 additions & 0 deletions python/samples/adk/basic/tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Regression test for the basic ADK sample runtime command."""

from pathlib import Path

from kagent.adk import cli


def test_run_loads_basic_sample_and_passes_app_to_uvicorn(monkeypatch):
monkeypatch.setenv("KAGENT_API_URL", "http://localhost:8083")
monkeypatch.setenv("KAGENT_GATEWAY_URL", "http://localhost:8083")
monkeypatch.setenv("KAGENT_NAME", "basic")
monkeypatch.setenv("KAGENT_NAMESPACE", "default")
monkeypatch.chdir(Path(__file__).parent.parent)
monkeypatch.syspath_prepend(str(Path.cwd()))
captured = {}
monkeypatch.setattr(cli.uvicorn, "run", lambda app, **kwargs: captured.update(app=app, kwargs=kwargs))

cli.run("basic", working_dir=".", host="0.0.0.0", local=True)

assert captured["kwargs"] == {"host": "0.0.0.0", "port": 8080, "workers": 1, "log_level": "info"}