Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: uv sync --locked --dev
run: uv sync --locked

- name: Run Ruff Linter
id: ruff-lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: uv sync --locked --dev --extra all
run: uv sync --locked
- name: Run tests and check coverage
run: uv run pytest --cov=a2a --cov-report term --cov-fail-under=88
- name: Show coverage summary in log
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ style = "pep440"
dev = [
"datamodel-code-generator>=0.30.0",
"mypy>=1.15.0",
"PyJWT>=2.0.0",
"pytest>=8.3.5",
"pytest-asyncio>=0.26.0",
"pytest-cov>=6.1.1",
Expand All @@ -101,14 +100,12 @@ dev = [
"types-protobuf",
"types-requests",
"pre-commit",
"fastapi>=0.115.2",
"sse-starlette",
"starlette",
"pyupgrade",
"autoflake",
"no_implicit_optional",
"trio",
"uvicorn>=0.35.0",
"a2a-sdk[all]",
]

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

[tool.uv.sources]
a2a-sdk = { workspace = true }

[tool.mypy]
plugins = ["pydantic.mypy"]
exclude = ["src/a2a/grpc/"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ trap cleanup EXIT
echo "Running integration tests..."
cd "$PROJECT_ROOT"

uv run --extra all pytest -v \
uv run pytest -v \
tests/server/tasks/test_database_task_store.py \
tests/server/tasks/test_database_push_notification_config_store.py \
"${PYTEST_ARGS[@]}"
52 changes: 50 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,58 @@
## Running the tests

1. Run the tests
1. Run all tests (including those requiring optional dependencies like grpc):
```bash
uv run pytest -v -s client/test_client_factory.py
uv run pytest
```

```

**Useful Flags:**
- `-v` (verbose): Shows more detailed output, including each test name as it runs.
- `-s` (no capture): Allows stdout (print statements) to show in the console. Useful for debugging.

Example with flags:
```bash
uv run pytest -v -s
```

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.

2. Run specific tests:
```bash
# Run a specific test file
uv run pytest tests/client/test_client_factory.py

# Run a specific test function
uv run pytest tests/client/test_client_factory.py::test_client_factory_connect_with_url

# Run tests in a specific folder
uv run pytest tests/client/
```

3. Run database integration tests (requires Docker):
```bash
./scripts/run_db_tests.sh
```

This script will:
- Start PostgreSQL and MySQL containers using Docker Compose.
- Run the database integration tests.
- Stop the containers after tests finish.

You can also run tests for a specific database:
```bash
./scripts/run_db_tests.sh --postgres
# or
./scripts/run_db_tests.sh --mysql
```

To keep the databases running for debugging:
```bash
./scripts/run_db_tests.sh --debug
```
(Follow the onscreen instructions to export DSNs and run pytest manually).

In case of failures, you can clean up the cache:

1. `uv clean`
Expand Down
10 changes: 2 additions & 8 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading