Skip to content

Commit 635f28a

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
chore: Added adk test to agentplatform.
PiperOrigin-RevId: 915894361
1 parent bd56d6b commit 635f28a

6 files changed

Lines changed: 1486 additions & 2 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Run unit tests for ADK on Python 3.11
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "unit_agentplatform_adk-3.11"
7+
}
8+
9+
# Run unit tests in parallel, splitting up by file
10+
env_vars: {
11+
key: "PYTEST_ADDOPTS"
12+
value: "-n=auto --dist=loadscope"
13+
}

noxfile.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
"unit_langchain",
109109
"unit_ag2",
110110
"unit_llama_index",
111+
"unit_agentplatform_adk",
111112
"system",
112113
"cover",
113114
"lint",
@@ -223,6 +224,7 @@ def default(session):
223224
"--ignore=tests/unit/architecture",
224225
"--ignore=tests/unit/vertexai/genai/replays",
225226
"--ignore=tests/unit/agentplatform/genai/replays",
227+
# "--ignore=tests/unit/agentplatform/frameworks",
226228
os.path.join("tests", "unit"),
227229
*session.posargs,
228230
)
@@ -297,6 +299,34 @@ def unit_ray(session, ray):
297299
)
298300

299301

302+
@nox.session(python=UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS)
303+
def unit_agentplatform_adk(session):
304+
# Install all test dependencies, then install this package in-place.
305+
306+
constraints_path = str(CURRENT_DIRECTORY / "testing" / "constraints-adk.txt")
307+
standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
308+
session.install(*standard_deps, "-c", constraints_path)
309+
310+
# Install adk extras
311+
session.install("-e", ".[adk_testing]", "-c", constraints_path)
312+
313+
# Run py.test against the unit tests.
314+
session.run(
315+
"py.test",
316+
"--quiet",
317+
"--junitxml=unit_agentplatform_adk_sponge_log.xml",
318+
"--cov=google",
319+
"--cov-append",
320+
"--cov-config=.coveragerc",
321+
"--cov-report=",
322+
"--cov-fail-under=0",
323+
os.path.join(
324+
"tests", "unit", "agentplatform", "frameworks", "test_frameworks_adk.py"
325+
),
326+
*session.posargs,
327+
)
328+
329+
300330
@nox.session(python=UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS)
301331
def unit_langchain(session):
302332
# Install all test dependencies, then install this package in-place.

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@
175175
"aiohttp", # for ADK users to use aiohttp rather than httpx client
176176
]
177177

178+
adk_testing_extra_require = [
179+
set(adk_extra_require + agent_engines_extra_require + ["absl-py", "pytest-xdist"])
180+
]
181+
178182
evaluation_extra_require = [
179183
"pandas >= 1.0.0",
180184
"tqdm>=4.23.0",
@@ -349,6 +353,7 @@
349353
"ray": ray_extra_require,
350354
"ray_testing": ray_testing_extra_require,
351355
"adk": adk_extra_require,
356+
"adk_testing": adk_testing_extra_require,
352357
"reasoningengine": reasoning_engine_extra_require,
353358
"agent_engines": agent_engines_extra_require,
354359
"evaluation": evaluation_extra_require,

testing/constraints-3.13.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ packaging==24.1 # Increased to unbreak canonicalize_version error (b/377774673)
1010
pytest-xdist==3.3.1 # Pinned to unbreak unit tests
1111
ray==2.5.0 # Pinned until 2.9.3 is verified for Ray tests
1212
ipython==8.22.2 # Pinned to unbreak TypeAliasType import error
13-
google-adk==0.0.2
13+
google-adk>=1.5.0
1414
google-genai>=1.10.0
1515
google-vizier==0.1.21
16-
pyarrow>=18.0.0
16+
pyarrow>=18.0.0
17+
opentelemetry-api==1.25.0
18+
opentelemetry-sdk==1.25.0
19+
opentelemetry-exporter-otlp-proto-http==1.25.0

testing/constraints-adk.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)