Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
23 changes: 21 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,31 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: pip install -e ".[dev,ui,logfire]"

- name: Run tests with coverage
run: pytest tests/ -v --cov-report=xml
- name: Run tests
shell: bash
run: |
if [ "${{ runner.os }}" = "Windows" ]; then
# Coverage instrumentation adds meaningful overhead on top of
# Windows's already-slower file I/O and process spawn, and only
# the ubuntu/3.12 run's coverage is uploaded below. `-o addopts=`
# clears pyproject's default `--cov` flags for this invocation.
#
# test_store_concurrency.py spawns 8 real subprocesses of its own
# and asserts they finish within a fixed deadline; run it outside
# the -n auto pool so it isn't also competing with three other
# xdist workers for the runner's CPU, which made its timeout
# flakier, not less so, under parallelism.
pytest tests/ -n auto -o addopts="" -v --ignore=tests/test_store_concurrency.py
pytest tests/test_store_concurrency.py -o addopts="" -v
else
pytest tests/ -n auto -v --cov-report=xml
fi

- name: Upload coverage reports to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ fallback_version = "0.1.0.dev0"
dev = [
"pytest>=8.0",
"pytest-cov>=5.0",
"pytest-xdist>=3.5",
"pre-commit>=3.7",
"ruff>=0.7",
"build>=1.2",
Expand Down
6 changes: 5 additions & 1 deletion tests/test_store_concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
_SESSION_ID = "CONCURRENT_SESSION"
_PLATFORM = "claude"
_CWD = "/concurrency-test"
_WRITER_TIMEOUT = 30
# Generous margin: this spawns _WRITER_COUNT real Python interpreters that
# contend for the same on-disk lock, and a busy or oversubscribed CI runner
# (observed on GitHub's Windows runners) can push interpreter start-up and
# lock-wait time well past what a quiet dev machine sees.
_WRITER_TIMEOUT = 90
_WRITER_SCRIPT = f"""
from pathlib import Path
import sys
Expand Down
Loading