Skip to content

Personal AI, On Personal Devices

Python

ci: parallelize the test suite and cut install/coverage overhead (#580)

Elliot Slusky9b7b3681f6e6
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index de995b2c..82c3bbb9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -23,6 +23,8 @@ jobs:
- name: Install uv
uses: astral-sh/[email protected]
+ with:
+ enable-cache: true
- name: Install dependencies
run: uv sync --extra dev --extra framework-comparison --extra server
@@ -55,6 +57,8 @@ jobs:
- name: Install uv
uses: astral-sh/[email protected]
+ with:
+ enable-cache: true
- name: Install dependencies
run: uv sync --extra dev --extra framework-comparison --extra server
@@ -63,8 +67,13 @@ jobs:
run: uv run maturin develop --manifest-path rust/crates/openjarvis-python/Cargo.toml
- name: Run tests
+ # COVERAGE_CORE=sysmon uses CPython 3.12's sys.monitoring backend,
+ # which is dramatically cheaper than the default C trace function.
+ # -n auto fans the suite out across all runner cores via pytest-xdist.
+ env:
+ COVERAGE_CORE: sysmon
run: |
- uv run pytest tests/ -v --tb=short -m "not live and not cloud and not hub" \
+ uv run pytest tests/ -n auto -q --tb=short -m "not live and not cloud and not hub" \
--cov=openjarvis \
--cov-report=term-missing \
--cov-report=xml \
@@ -107,6 +116,8 @@ jobs:
- name: Install uv
uses: astral-sh/[email protected]
+ with:
+ enable-cache: true
- name: Install dependencies
run: uv sync --extra dev --extra server
diff --git a/pyproject.toml b/pyproject.toml
index c0c0ee7d..3d3c94a8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -48,6 +48,7 @@ dev = [
"pytest>=8",
"pytest-asyncio>=0.24",
"pytest-cov>=5",
+ "pytest-xdist>=3",
"respx>=0.22",
"ruff>=0.4",
"pre-commit>=3.0",