Skip to content

Conversation

@tony
Copy link
Member

@tony tony commented Dec 30, 2025

Summary

  • Add XDG-based persistent cache for pytest fixtures (~/.cache/libvcs/pytest/)
  • Add RepoFixtureResult with cache hit/miss tracking
  • Add atomic_init for race-free initialization with pytest-xdist
  • Include FileLock module for atomic operations

Test plan

  • Unit tests for FileLock
  • Fixture performance benchmarks
  • Cache hit/miss tracking verification

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 64.57086% with 355 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.73%. Comparing base (f0e705d) to head (e7e2bf4).

Files with missing lines Patch % Lines
tests/test_fixture_performance.py 25.42% 176 Missing ⚠️
src/libvcs/_internal/file_lock.py 62.13% 72 Missing and 6 partials ⚠️
src/libvcs/pytest_plugin.py 51.18% 58 Missing and 4 partials ⚠️
conftest.py 50.66% 36 Missing and 1 partial ⚠️
tests/_internal/test_file_lock.py 99.44% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #502      +/-   ##
==========================================
+ Coverage   53.22%   54.73%   +1.51%     
==========================================
  Files          38       41       +3     
  Lines        5676     6643     +967     
  Branches     1063     1122      +59     
==========================================
+ Hits         3021     3636     +615     
- Misses       2144     2486     +342     
- Partials      511      521      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tony added 7 commits December 30, 2025 08:50
…module

why: Enable safe concurrent access to shared resources across multiple
processes, particularly for pytest-xdist parallel test execution.

what:
- Add FileLock class with context manager support
- Add atomic_init() for one-time initialization with locking
- Support both sync and async usage patterns
why: Improve test performance with session-scoped caching and atomic
initialization for pytest-xdist compatibility.

what:
- Add XDG-based persistent cache for fixture master copies
- Add RepoFixtureResult dataclass with cache hit/miss tracking
- Add atomic_init for race-free initialization in parallel tests
- Optimize git_repo, hg_repo, svn_repo fixtures with caching
what:
- Add FileLock context manager tests
- Add atomic_init race condition tests
- Add timeout and error handling tests
what:
- Add fixture cache hit/miss verification tests
- Add persistent cache version key tests
- Add VCS-native copy vs shutil.copytree benchmarks
what:
- Add docs/internals/file_lock.md with API reference
- Add file_lock to internals toctree
what:
- Add performance and benchmark pytest markers to pyproject.toml
- Add fixture cache hit/miss tracking hooks to conftest.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants