feat(web): Add /health and /version endpoints to ADK web server

These endpoints provide basic health checks and version information for the running ADK server, including the ADK version and Python runtime details. The version information will be used to generate ADK conformance test report.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 868283421
This commit is contained in:
Liang Wu
2026-02-10 13:07:21 -08:00
committed by Copybara-Service
parent 2f0fe97729
commit 25ec2c6b61
2 changed files with 32 additions and 0 deletions
+18
View File
@@ -1530,5 +1530,23 @@ def test_builder_save_rejects_traversal(builder_test_client, tmp_path):
assert not (tmp_path / "app" / "tmp" / "escape.yaml").exists()
def test_health_endpoint(test_app):
"""Test the health endpoint."""
response = test_app.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
def test_version_endpoint(test_app):
"""Test the version endpoint."""
response = test_app.get("/version")
assert response.status_code == 200
data = response.json()
assert "version" in data
assert "language" in data
assert data["language"] == "python"
assert "language_version" in data
if __name__ == "__main__":
pytest.main(["-xvs", __file__])