From 0958211b93c2e90ca298f266b3008511cfa7d64f Mon Sep 17 00:00:00 2001 From: A Vertex SDK engineer Date: Fri, 15 May 2026 02:41:49 -0700 Subject: [PATCH] chore: Added agentplatform templates tests to kokoro presubmit (non-blocking). PiperOrigin-RevId: 915894361 --- .../unit_agentplatform_adk_py311.cfg | 13 +++ .../unit_agentplatform_ag2_py311.cfg | 13 +++ .../unit_agentplatform_langchain_py311.cfg | 13 +++ noxfile.py | 99 +++++++++++++++++++ testing/constraints-adk.txt | 0 5 files changed, 138 insertions(+) create mode 100644 .kokoro/presubmit/unit_agentplatform_adk_py311.cfg create mode 100644 .kokoro/presubmit/unit_agentplatform_ag2_py311.cfg create mode 100644 .kokoro/presubmit/unit_agentplatform_langchain_py311.cfg create mode 100644 testing/constraints-adk.txt diff --git a/.kokoro/presubmit/unit_agentplatform_adk_py311.cfg b/.kokoro/presubmit/unit_agentplatform_adk_py311.cfg new file mode 100644 index 0000000000..3a3c9ac653 --- /dev/null +++ b/.kokoro/presubmit/unit_agentplatform_adk_py311.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Run unit tests for ADK on Python 3.11 +env_vars: { + key: "NOX_SESSION" + value: "unit_agentplatform_adk-3.11" +} + +# Run unit tests in parallel, splitting up by file +env_vars: { + key: "PYTEST_ADDOPTS" + value: "-n=auto --dist=loadscope" +} diff --git a/.kokoro/presubmit/unit_agentplatform_ag2_py311.cfg b/.kokoro/presubmit/unit_agentplatform_ag2_py311.cfg new file mode 100644 index 0000000000..8a4553fc89 --- /dev/null +++ b/.kokoro/presubmit/unit_agentplatform_ag2_py311.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Run unit tests for AG2 on Python 3.11 +env_vars: { + key: "NOX_SESSION" + value: "unit_agentplatform_ag2-3.11" +} + +# Run unit tests in parallel, splitting up by file +env_vars: { + key: "PYTEST_ADDOPTS" + value: "-n=auto --dist=loadscope" +} diff --git a/.kokoro/presubmit/unit_agentplatform_langchain_py311.cfg b/.kokoro/presubmit/unit_agentplatform_langchain_py311.cfg new file mode 100644 index 0000000000..691074fe93 --- /dev/null +++ b/.kokoro/presubmit/unit_agentplatform_langchain_py311.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Run unit tests for LangChain on Python 3.11 +env_vars: { + key: "NOX_SESSION" + value: "unit_agentplatform_langchain-3.11" +} + +# Run unit tests in parallel, splitting up by file +env_vars: { + key: "PYTEST_ADDOPTS" + value: "-n=auto --dist=loadscope" +} diff --git a/noxfile.py b/noxfile.py index 057b036cac..74f70d5dac 100644 --- a/noxfile.py +++ b/noxfile.py @@ -61,6 +61,7 @@ ) UNIT_TEST_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] +UNIT_TEST_ADK_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] UNIT_TEST_AG2_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] UNIT_TEST_LLAMA_INDEX_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] @@ -108,6 +109,9 @@ "unit_langchain", "unit_ag2", "unit_llama_index", + "unit_agentplatform_adk", + "unit_agentplatform_langchain", + "unit_agentplatform_ag2", "system", "cover", "lint", @@ -298,6 +302,101 @@ def unit_ray(session, ray): ) +@nox.session(python=UNIT_TEST_ADK_PYTHON_VERSIONS) +def unit_agentplatform_adk(session): + # Install all test dependencies, then install this package in-place. + + constraints_path = str(CURRENT_DIRECTORY / "testing" / "constraints-adk.txt") + standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES + session.install(*standard_deps, "-c", constraints_path) + + # Install adk extras + session.install("-e", ".[adk_testing]", "-c", constraints_path) + + # Run py.test against the unit tests. + session.run( + "py.test", + "--quiet", + "--junitxml=unit_agentplatform_adk_sponge_log.xml", + "--cov=google", + "--cov-append", + "--cov-config=.coveragerc", + "--cov-report=", + "--cov-fail-under=0", + os.path.join( + "tests", "unit", "agentplatform", "frameworks", "test_frameworks_adk.py" + ), + *session.posargs, + ) + + +@nox.session(python=UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS) +def unit_agentplatform_langchain(session): + # Install all test dependencies, then install this package in-place. + + constraints_path = str(CURRENT_DIRECTORY / "testing" / "constraints-langchain.txt") + standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES + session.install(*standard_deps, "-c", constraints_path) + + # Install langchain extras + session.install("-e", ".[langchain_testing]", "-c", constraints_path) + + # Run py.test against the unit tests. + session.run( + "py.test", + "--quiet", + "--junitxml=unit_agentplatform_langchain_sponge_log.xml", + "--cov=google", + "--cov-append", + "--cov-config=.coveragerc", + "--cov-report=", + "--cov-fail-under=0", + os.path.join( + "tests", + "unit", + "agentplatform", + "frameworks", + "test_frameworks_langchain.py", + ), + os.path.join( + "tests", + "unit", + "agentplatform", + "frameworks", + "test_frameworks_langgraph.py", + ), + *session.posargs, + ) + + +@nox.session(python=UNIT_TEST_AG2_PYTHON_VERSIONS) +def unit_agentplatform_ag2(session): + # Install all test dependencies, then install this package in-place. + + constraints_path = str(CURRENT_DIRECTORY / "testing" / "constraints-ag2.txt") + standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES + session.install(*standard_deps, "-c", constraints_path) + + # Install ag2 extras + session.install("-e", ".[ag2_testing]", "-c", constraints_path) + + # Run py.test against the unit tests. + session.run( + "py.test", + "--quiet", + "--junitxml=unit_agentplatform_ag2_sponge_log.xml", + "--cov=google", + "--cov-append", + "--cov-config=.coveragerc", + "--cov-report=", + "--cov-fail-under=0", + os.path.join( + "tests", "unit", "agentplatform", "frameworks", "test_frameworks_ag2.py" + ), + *session.posargs, + ) + + @nox.session(python=UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS) def unit_langchain(session): # Install all test dependencies, then install this package in-place. diff --git a/testing/constraints-adk.txt b/testing/constraints-adk.txt new file mode 100644 index 0000000000..e69de29bb2