Skip to content

Commit fd179ba

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

5 files changed

Lines changed: 141 additions & 6 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: 102 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@
6161
)
6262

6363
UNIT_TEST_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
64-
UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
65-
UNIT_TEST_AG2_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
66-
UNIT_TEST_LLAMA_INDEX_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
64+
UNIT_TEST_TEMPLATES_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
6765
PYTHON_TO_RAY_VERSIONS = {
6866
"3.10": ["2.33.0", "2.42.0"],
6967
"3.11": ["2.42.0", "2.47.1"],
@@ -108,6 +106,9 @@
108106
"unit_langchain",
109107
"unit_ag2",
110108
"unit_llama_index",
109+
"unit_agentplatform_adk",
110+
"unit_agentplatform_langchain",
111+
"unit_agentplatform_ag2",
111112
"system",
112113
"cover",
113114
"lint",
@@ -298,7 +299,102 @@ def unit_ray(session, ray):
298299
)
299300

300301

301-
@nox.session(python=UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS)
302+
@nox.session(python=UNIT_TEST_TEMPLATES_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+
330+
@nox.session(python=UNIT_TEST_TEMPLATES_PYTHON_VERSIONS)
331+
def unit_agentplatform_langchain(session):
332+
# Install all test dependencies, then install this package in-place.
333+
334+
constraints_path = str(CURRENT_DIRECTORY / "testing" / "constraints-langchain.txt")
335+
standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
336+
session.install(*standard_deps, "-c", constraints_path)
337+
338+
# Install langchain extras
339+
session.install("-e", ".[langchain_testing]", "-c", constraints_path)
340+
341+
# Run py.test against the unit tests.
342+
session.run(
343+
"py.test",
344+
"--quiet",
345+
"--junitxml=unit_agentplatform_langchain_sponge_log.xml",
346+
"--cov=google",
347+
"--cov-append",
348+
"--cov-config=.coveragerc",
349+
"--cov-report=",
350+
"--cov-fail-under=0",
351+
os.path.join(
352+
"tests",
353+
"unit",
354+
"agentplatform",
355+
"frameworks",
356+
"test_frameworks_langchain.py",
357+
),
358+
os.path.join(
359+
"tests",
360+
"unit",
361+
"agentplatform",
362+
"frameworks",
363+
"test_frameworks_langgraph.py",
364+
),
365+
*session.posargs,
366+
)
367+
368+
369+
@nox.session(python=UNIT_TEST_TEMPLATES_PYTHON_VERSIONS)
370+
def unit_agentplatform_ag2(session):
371+
# Install all test dependencies, then install this package in-place.
372+
373+
constraints_path = str(CURRENT_DIRECTORY / "testing" / "constraints-ag2.txt")
374+
standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
375+
session.install(*standard_deps, "-c", constraints_path)
376+
377+
# Install ag2 extras
378+
session.install("-e", ".[ag2_testing]", "-c", constraints_path)
379+
380+
# Run py.test against the unit tests.
381+
session.run(
382+
"py.test",
383+
"--quiet",
384+
"--junitxml=unit_agentplatform_ag2_sponge_log.xml",
385+
"--cov=google",
386+
"--cov-append",
387+
"--cov-config=.coveragerc",
388+
"--cov-report=",
389+
"--cov-fail-under=0",
390+
os.path.join(
391+
"tests", "unit", "agentplatform", "frameworks", "test_frameworks_ag2.py"
392+
),
393+
*session.posargs,
394+
)
395+
396+
397+
@nox.session(python=UNIT_TEST_TEMPLATES_PYTHON_VERSIONS)
302398
def unit_langchain(session):
303399
# Install all test dependencies, then install this package in-place.
304400

@@ -324,7 +420,7 @@ def unit_langchain(session):
324420
)
325421

326422

327-
@nox.session(python=UNIT_TEST_AG2_PYTHON_VERSIONS)
423+
@nox.session(python=UNIT_TEST_TEMPLATES_PYTHON_VERSIONS)
328424
def unit_ag2(session):
329425
# Install all test dependencies, then install this package in-place.
330426

@@ -350,7 +446,7 @@ def unit_ag2(session):
350446
)
351447

352448

353-
@nox.session(python=UNIT_TEST_LLAMA_INDEX_PYTHON_VERSIONS)
449+
@nox.session(python=UNIT_TEST_TEMPLATES_PYTHON_VERSIONS)
354450
def unit_llama_index(session):
355451
# Install all test dependencies, then install this package in-place.
356452

testing/constraints-adk.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)