Skip to content

Commit 04ce377

Browse files
authored
test: add more test cases to "install-smoke" (#1008)
1 parent 6b46ceb commit 04ce377

3 files changed

Lines changed: 42 additions & 1 deletion

File tree

.github/workflows/install-smoke.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ jobs:
4242
extras: ''
4343
- name: http-server
4444
extras: '[http-server]'
45+
- name: grpc
46+
extras: '[grpc]'
47+
- name: telemetry
48+
extras: '[telemetry]'
49+
- name: sql
50+
extras: '[sql]'
4551
steps:
4652
- name: Checkout code
4753
uses: actions/checkout@v6

scripts/test_install_smoke.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
smoke-test. Available profiles:
1616
base -- `pip install a2a-sdk`
1717
http-server -- `pip install a2a-sdk[http-server]`
18+
grpc -- `pip install a2a-sdk[grpc]`
19+
telemetry -- `pip install a2a-sdk[telemetry]`
20+
sql -- `pip install a2a-sdk[sql]`
1821
1922
Exit codes:
2023
0 - All imports for the profile succeeded
@@ -80,10 +83,36 @@
8083
'a2a.server.routes.rest_routes',
8184
]
8285

86+
# Modules that MUST be importable with only the base + `grpc` extras
87+
# installed (no `http-server`, `sql`, `signing`, `telemetry`, etc.).
88+
GRPC_MODULES = [
89+
'a2a.server.request_handlers.grpc_handler',
90+
'a2a.client.transports.grpc',
91+
'a2a.compat.v0_3.grpc_handler',
92+
'a2a.compat.v0_3.grpc_transport',
93+
]
94+
95+
# Modules that MUST be importable with only the base + `telemetry`
96+
# extras installed.
97+
TELEMETRY_MODULES = [
98+
'a2a.utils.telemetry',
99+
]
100+
101+
# Modules that MUST be importable with only the base + `sql` extras
102+
# installed (covers postgresql/mysql/sqlite drivers via SQLAlchemy).
103+
SQL_MODULES = [
104+
'a2a.server.models',
105+
'a2a.server.tasks.database_task_store',
106+
'a2a.server.tasks.database_push_notification_config_store',
107+
]
108+
83109

84110
PROFILES: dict[str, list[str]] = {
85111
'base': CORE_MODULES,
86112
'http-server': CORE_MODULES + HTTP_SERVER_MODULES,
113+
'grpc': CORE_MODULES + GRPC_MODULES,
114+
'telemetry': CORE_MODULES + TELEMETRY_MODULES,
115+
'sql': CORE_MODULES + SQL_MODULES,
87116
}
88117

89118

scripts/test_install_smoke.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# Available profiles (must match those in scripts/test_install_smoke.py):
1010
# base -- `pip install a2a-sdk`
1111
# http-server -- `pip install a2a-sdk[http-server]`
12+
# grpc -- `pip install a2a-sdk[grpc]`
13+
# telemetry -- `pip install a2a-sdk[telemetry]`
14+
# sql -- `pip install a2a-sdk[sql]`
1215
#
1316
# Usage:
1417
# scripts/test_install_smoke.sh [profile] [python-version]
@@ -24,7 +27,7 @@ set -o pipefail
2427
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
2528
cd "$REPO_ROOT"
2629

27-
ALL_PROFILES=(base http-server)
30+
ALL_PROFILES=(base http-server grpc telemetry sql)
2831

2932
PROFILE_ARG="${1:-}"
3033
PYTHON_VERSION="${2:-}"
@@ -39,6 +42,9 @@ extras_for_profile() {
3942
case "$1" in
4043
base) echo "" ;;
4144
http-server) echo "[http-server]" ;;
45+
grpc) echo "[grpc]" ;;
46+
telemetry) echo "[telemetry]" ;;
47+
sql) echo "[sql]" ;;
4248
*)
4349
echo "Unknown profile '$1'. Available: ${ALL_PROFILES[*]}" >&2
4450
return 1

0 commit comments

Comments
 (0)