Skip to content

Commit aebe9be

Browse files
authored
Merge branch 'main' into patch-1
2 parents f050cf9 + beb2b4b commit aebe9be

6 files changed

Lines changed: 59 additions & 17 deletions

File tree

.github/workflows/linter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: |
2424
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
2525
- name: Install dependencies
26-
run: uv sync --locked --dev
26+
run: uv sync --locked
2727

2828
- name: Run Ruff Linter
2929
id: ruff-lint

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: |
5454
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
5555
- name: Install dependencies
56-
run: uv sync --locked --dev --extra all
56+
run: uv sync --locked
5757
- name: Run tests and check coverage
5858
run: uv run pytest --cov=a2a --cov-report term --cov-fail-under=88
5959
- name: Show coverage summary in log

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ style = "pep440"
8989
dev = [
9090
"datamodel-code-generator>=0.30.0",
9191
"mypy>=1.15.0",
92-
"PyJWT>=2.0.0",
9392
"pytest>=8.3.5",
9493
"pytest-asyncio>=0.26.0",
9594
"pytest-cov>=6.1.1",
@@ -101,14 +100,12 @@ dev = [
101100
"types-protobuf",
102101
"types-requests",
103102
"pre-commit",
104-
"fastapi>=0.115.2",
105-
"sse-starlette",
106-
"starlette",
107103
"pyupgrade",
108104
"autoflake",
109105
"no_implicit_optional",
110106
"trio",
111107
"uvicorn>=0.35.0",
108+
"a2a-sdk[all]",
112109
]
113110

114111
[[tool.uv.index]]
@@ -117,6 +114,9 @@ url = "https://test.pypi.org/simple/"
117114
publish-url = "https://test.pypi.org/legacy/"
118115
explicit = true
119116

117+
[tool.uv.sources]
118+
a2a-sdk = { workspace = true }
119+
120120
[tool.mypy]
121121
plugins = ["pydantic.mypy"]
122122
exclude = ["src/a2a/grpc/"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ trap cleanup EXIT
9696
echo "Running integration tests..."
9797
cd "$PROJECT_ROOT"
9898

99-
uv run --extra all pytest -v \
99+
uv run pytest -v \
100100
tests/server/tasks/test_database_task_store.py \
101101
tests/server/tasks/test_database_push_notification_config_store.py \
102102
"${PYTEST_ARGS[@]}"

tests/README.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,58 @@
11
## Running the tests
22

3-
1. Run the tests
3+
1. Run all tests (excluding those requiring real DBs, see item 3):
44
```bash
5-
uv run pytest -v -s client/test_client_factory.py
5+
uv run pytest
66
```
77

8+
```
9+
10+
**Useful Flags:**
11+
- `-v` (verbose): Shows more detailed output, including each test name as it runs.
12+
- `-s` (no capture): Allows stdout (print statements) to show in the console. Useful for debugging.
13+
14+
Example with flags:
15+
```bash
16+
uv run pytest -v -s
17+
```
18+
19+
Note: Some tests require external databases (PostgreSQL, MySQL) and will be skipped if the corresponding environment variables (`POSTGRES_TEST_DSN`, `MYSQL_TEST_DSN`) are not set.
20+
21+
2. Run specific tests:
22+
```bash
23+
# Run a specific test file
24+
uv run pytest tests/client/test_client_factory.py
25+
26+
# Run a specific test function
27+
uv run pytest tests/client/test_client_factory.py::test_client_factory_connect_with_url
28+
29+
# Run tests in a specific folder
30+
uv run pytest tests/client/
31+
```
32+
33+
3. Run database integration tests (requires Docker):
34+
```bash
35+
./scripts/run_db_tests.sh
36+
```
37+
38+
This script will:
39+
- Start PostgreSQL and MySQL containers using Docker Compose.
40+
- Run the database integration tests.
41+
- Stop the containers after tests finish.
42+
43+
You can also run tests for a specific database:
44+
```bash
45+
./scripts/run_db_tests.sh --postgres
46+
# or
47+
./scripts/run_db_tests.sh --mysql
48+
```
49+
50+
To keep the databases running for debugging:
51+
```bash
52+
./scripts/run_db_tests.sh --debug
53+
```
54+
(Follow the onscreen instructions to export DSNs and run pytest manually).
55+
856
In case of failures, you can clean up the cache:
957

1058
1. `uv clean`

uv.lock

Lines changed: 2 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)