ci(tests[benchmarks]) Add CodSpeed performance benchmarks#525
Open
ci(tests[benchmarks]) Add CodSpeed performance benchmarks#525
Conversation
why: Track GitSync.obtain (and future hot paths) for performance regressions in CI. Replaces the long-stalled poetry-era #471 with a uv-native, functional-tests implementation against current master. what: - pyproject.toml: add `pytest-codspeed` to `testing` group; register a `benchmark` marker; deselect benchmarks by default via `addopts`; let mypy ignore missing `pytest_codspeed.*` stubs - tests/benchmarks/test_sync_git.py: add functional-style benchmark for `GitSync.obtain` against an initial-commit remote - .github/workflows/tests.yml: add `benchmarks` job using `CodSpeedHQ/action@v3` on pull requests and master pushes - CHANGES: note the benchmark addition under 0.41.x
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #525 +/- ##
=======================================
Coverage 58.23% 58.23%
=======================================
Files 40 41 +1
Lines 6489 6499 +10
Branches 1098 1098
=======================================
+ Hits 3779 3785 +6
- Misses 2177 2181 +4
Partials 533 533 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GitSync.obtain(and future hot paths) performance over timetests/benchmarks/(noclass TestX:patterns)benchmarkmarker; opt-in withpytest tests/benchmarks --codspeed -m benchmarkChanges
pyproject.tomlpytest-codspeedto thetestingdependency groupbenchmarkmarkeraddoptsadds-m 'not benchmark'so regularuv run py.testskips benchmarkspytest_codspeed.*stubstests/benchmarks/test_sync_git.py— single representative benchmark forGitSync.obtainagainst an initial-commit remote (~49ms locally).github/workflows/tests.yml— newbenchmarksjob runningCodSpeedHQ/action@v3on pull requests and master pushesCHANGES— entry under 0.41.x (unreleased)Test plan
uv run ruff check .— cleanuv run ruff format .— cleanuv run mypy— cleanuv run py.test --reruns 0 -vvv— 615 passed, 1 skipped, 1 deselected (the new benchmark, as designed)just build-docs— succeedsuv run --group testing py.test tests/benchmarks --codspeed -m benchmark) —test_git_obtain_initial_commit_repo48.8ms medianSupersedes #471 (which targeted the poetry-era pyproject.toml; closed).