You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: CI/testing improvements for parallel test execution (#317)
* chore: CI/testing improvements for parallel test execution
- Add workflows-dev pytest command with parallel test runner
- Add pytest-xdist for parallel test execution (-nauto)
- Add timeouts to prevent test hangs (--timeout=10/60/120)
- Use module-scoped async fixtures for faster tests
- Remove mypy in favor of basedpyright/ty type checking
- Add test-docker CI job for integration tests with testcontainers
- Exclude integration tests from Python 3.9/3.14 in CI matrix
Copy file name to clipboardExpand all lines: AGENTS.md
+22-21Lines changed: 22 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,24 +13,24 @@ This is the LlamaIndex Workflows library - an event-driven, async-first framewor
13
13
## Development Commands
14
14
15
15
### Testing
16
-
```bash
17
-
# Run all tests
18
-
uv run --directory packages/llama-index-workflows pytest
19
16
20
-
# Run tests with coverage
21
-
uv run --directory packages/llama-index-workflows pytest --cov=src/workflows --cov-report=html
17
+
Use the `dev` CLI to run tests:
18
+
19
+
```bash
20
+
# Run all package tests
21
+
uv run dev
22
22
23
-
# Run specific test files
24
-
uv run --directory packages/llama-index-workflows pytest tests/test_server.py tests/test_server_utils.py
23
+
# Filter by substring match
24
+
uv run dev -p workflows
25
+
uv run dev -p server -p client
25
26
26
-
#Run tests in verbose mode
27
-
uv run --directory packages/llama-index-workflows pytest -v
27
+
#Pass pytest args after --
28
+
uv run dev -- -k test_name
28
29
```
29
30
30
31
### Linting & Formatting
31
32
```bash
32
-
# Run pre-commit hooks
33
-
uv run --directory packages/llama-index-workflows pre-commit run -a
33
+
uv run pre-commit run -a
34
34
```
35
35
36
36
## Project Structure
@@ -46,7 +46,7 @@ uv run --directory packages/llama-index-workflows pre-commit run -a
46
46
-**WorkflowServer** - HTTP server for serving workflows as web services
47
47
48
48
## Notes for Claude
49
-
- Always run tests after making changes: `uv run --directory packages/llama-index-workflows pytest`
49
+
- Always run tests after making changes: `uv run dev`
50
50
- Never use classes for tests, only use pytest functions
51
51
- Always annotate with types function arguments and return values
52
52
- The project uses async/await extensively
@@ -62,17 +62,11 @@ Make sure to install uv as the package manager. Development commands rely on it.
62
62
curl -fsSL https://astral.sh/uv/install.sh | sh
63
63
```
64
64
65
-
Always run test tests and pre-commit commands before committing. They run very fast and are not verbose.
66
-
67
-
Tests:
65
+
Always run tests and pre-commit before committing:
68
66
69
67
```bash
70
-
uv run --directory packages/llama-index-workflows pytest -nauto --timeout=1
71
-
```
72
-
73
-
Linting, typechecking, and formatting:
74
-
```bash
75
-
uv run --directory packages/llama-index-workflows pre-commit run -a
68
+
uv run dev
69
+
uv run pre-commit run -a
76
70
```
77
71
78
72
## Testing Patterns
@@ -84,3 +78,10 @@ We use **pytest** with idiomatic pytest patterns. Follow these guidelines:
84
78
-**Prefer Real Objects Over Mocks**: Use simple dataclasses and real objects directly when available rather than mocking them. Only mock external dependencies or things that are truly difficult to instantiate.
85
79
-**DRY Test Setup**: Do not repeat patches or setup code. Create reusable abstractions—fixtures, helper functions, or module-level constants—that can be shared across tests. Tests can easily be overwhelmed with setup; start from a rich suite of testing utilities to enable many small, expressive tests.
86
80
-**Simple Testing Utilities**: Testing utilities should be basic—just functions, fixtures, and global variables. Avoid over-engineering test infrastructure.
81
+
82
+
## Coding Style
83
+
84
+
- Always use `from __future__ import annotations` at the top of each test file. Never use string annotations.
85
+
- Include the standard SPDX license header at the top of each test file.
86
+
- Comments are useful, but avoid fluff.
87
+
- Never use inline imports unless required to prevent circular dependencies.
0 commit comments