8000 Moves unittests to root folder and adds github action to run unit tes… · asishantony/adk-python@05142a0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 05142a0

Browse files
authored
Moves unittests to root folder and adds github action to run unit tests. (google#72)
* Move unit tests to root package. * Adds deps to "test" extra, and mark two broken tests in tests/unittests/auth/test_auth_handler.py * Adds github workflow * minor fix in lite_llm.py for python 3.9. * format pyproject.toml
1 parent 59117b9 commit 05142a0

File tree

66 files changed

+50
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+50
-2
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Python Unit Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.9", "3.10", "3.11"]
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install uv
26+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
27+
28+
- name: Install dependencies
29+
run: |
30+
uv venv .venv
31+
source .venv/bin/activate
32+
uv sync --extra test
33+
34+
- name: Run unit tests with pytest
35+
run: |
36+
source .venv/bin/activate
37+
pytest tests/unittests \
38+
--ignore=tests/unittests/tools/google_api_tool/test_googleapi_to_openapi_converter.py \
39+
--ignore=tests/unittests/artifacts/test_artifact_service.py

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ eval = [
7979

8080
test = [
8181
# go/keep-sorted start
82+
"anthropic>=0.43.0", # For anthropic model tests
8283
"langchain-community>=0.3.17",
84+
"langgraph>=0.2.60", # For LangGraphAgent
85+
"litellm>=1.63.11", # For LiteLLM tests
86+
"llama-index-readers-file>=0.4.0", # for retrieval tests
8387
"pytest-asyncio>=0.25.0",
8488
"pytest-mock>=3.14.0",
8589
"pytest-xdist>=3.6.1",

src/google/adk/models/lite_llm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ def _content_to_message_param(
183183
)
184184

185185

186-
def _get_content(parts: Iterable[types.Part]) -> OpenAIMessageContent | str:
186+
def _get_content(
187+
parts: Iterable[types.Part],
188+
) -> Union[OpenAIMessageContent, str]:
187189
"""Converts a list of parts to litellm content.
188190
189191
Args:

0 commit comments

Comments
 (0)
0