mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
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:
committed by
Copybara-Service
parent
2f0fe97729
commit
25ec2c6b61
@@ -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__])
|
||||
|
||||
Reference in New Issue
Block a user