Skip to content

Commit 0958211

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
chore: Added agentplatform templates tests to kokoro presubmit (non-blocking).
PiperOrigin-RevId: 915894361
1 parent f1a6a5e commit 0958211

5 files changed

Lines changed: 138 additions & 0 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+
}
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 AG2 on Python 3.11
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "unit_agentplatform_ag2-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+
}
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 LangChain on Python 3.11
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "unit_agentplatform_langchain-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: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
)
6262

6363
UNIT_TEST_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
64+
UNIT_TEST_ADK_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
6465
UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
6566
UNIT_TEST_AG2_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
6667
UNIT_TEST_LLAMA_INDEX_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
@@ -108,6 +109,9 @@
108109
"unit_langchain",
109110
"unit_ag2",
110111
"unit_llama_index",
112+
"unit_agentplatform_adk",
113+
"unit_agentplatform_langchain",
114+
"unit_agentplatform_ag2",
111115
"system",
112116
"cover",
113117
"lint",
@@ -298,6 +302,101 @@ def unit_ray(session, ray):
298302
)
299303

300304

305+
@nox.session(python=UNIT_TEST_ADK_PYTHON_VERSIONS)
306+
def unit_agentplatform_adk(session):
307+
# Install all test dependencies, then install this package in-place.
308+
309+
constraints_path = str(CURRENT_DIRECTORY / "testing" / "constraints-adk.txt")
310+
standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
311+
session.install(*standard_deps, "-c", constraints_path)
312+
313+
# Install adk extras
314+
session.install("-e", ".[adk_testing]", "-c", constraints_path)
315+
316+
# Run py.test against the unit tests.
317+
session.run(
318+
"py.test",
319+
"--quiet",
320+
"--junitxml=unit_agentplatform_adk_sponge_log.xml",
321+
"--cov=google",
322+
"--cov-append",
323+
"--cov-config=.coveragerc",
324+
"--cov-report=",
325+
"--cov-fail-under=0",
326+
os.path.join(
327+
"tests", "unit", "agentplatform", "frameworks", "test_frameworks_adk.py"
328+
),
329+
*session.posargs,
330+
)
331+
332+
333+
@nox.session(python=UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS)
334+
def unit_agentplatform_langchain(session):
335+
# Install all test dependencies, then install this package in-place.
336+
337+
constraints_path = str(CURRENT_DIRECTORY / "testing" / "constraints-langchain.txt")
338+
standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
339+
session.install(*standard_deps, "-c", constraints_path)
340+
341+
# Install langchain extras
342+
session.install("-e", ".[langchain_testing]", "-c", constraints_path)
343+
344+
# Run py.test against the unit tests.
345+
session.run(
346+
"py.test",
347+
"--quiet",
348+
"--junitxml=unit_agentplatform_langchain_sponge_log.xml",
349+
"--cov=google",
350+
"--cov-append",
351+
"--cov-config=.coveragerc",
352+
"--cov-report=",
353+
"--cov-fail-under=0",
354+
os.path.join(
355+
"tests",
356+
"unit",
357+
"agentplatform",
358+
"frameworks",
359+
"test_frameworks_langchain.py",
360+
),
361+
os.path.join(
362+
"tests",
363+
"unit",
364+
"agentplatform",
365+
"frameworks",
366+
"test_frameworks_langgraph.py",
367+
),
368+
*session.posargs,
369+
)
370+
371+
372+
@nox.session(python=UNIT_TEST_AG2_PYTHON_VERSIONS)
373+
def unit_agentplatform_ag2(session):
374+
# Install all test dependencies, then install this package in-place.
375+
376+
constraints_path = str(CURRENT_DIRECTORY / "testing" / "constraints-ag2.txt")
377+
standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
378+
session.install(*standard_deps, "-c", constraints_path)
379+
380+
# Install ag2 extras
381+
session.install("-e", ".[ag2_testing]", "-c", constraints_path)
382+
383+
# Run py.test against the unit tests.
384+
session.run(
385+
"py.test",
386+
"--quiet",
387+
"--junitxml=unit_agentplatform_ag2_sponge_log.xml",
388+
"--cov=google",
389+
"--cov-append",
390+
"--cov-config=.coveragerc",
391+
"--cov-report=",
392+
"--cov-fail-under=0",
393+
os.path.join(
394+
"tests", "unit", "agentplatform", "frameworks", "test_frameworks_ag2.py"
395+
),
396+
*session.posargs,
397+
)
398+
399+
301400
@nox.session(python=UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS)
302401
def unit_langchain(session):
303402
# Install all test dependencies, then install this package in-place.

testing/constraints-adk.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)