Repository navigation
Conversation
The coverage lane builds without Cython (CASS_DRIVER_NO_CYTHON=1), so the Cython lz4 codec isn't available, and the `lz4` package is only in the optional compress-lz4 extra. As a result no lz4 codec exists in the lane: connection.py's lz4 import/compat block never runs and the lz4-dependent tests in tests/unit/test_segment.py skip. Add `--with lz4` to the main unit-test `uv run` so those paths are measured. `--with` layers lz4 over the project env for that invocation only; the project env itself is left untouched. Only the unit step gets it. Cluster.compression defaults to True and the connection picks the first codec both sides support, so installing lz4 for the whole lane would make the integration run negotiate LZ4. With #1088, LZ4 is auto-selected only when the `lz4` package is installed, so it is opt-in; the integration step should keep measuring the default, uncompressed behaviour. The asyncio reactor step doesn't exercise compression and doesn't need it either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QYcPjKDEQaQTfxpdfsFjZA
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Change: Other Merge Risk: ⚪ Minimal · up to This change makes LZ4 available only to the unit-test run; the integration run retains its uncompressed path. No merge-blocking risk is established. Pre-merge checks |
|
# Conflicts: # scripts/coverage.sh
Update: #1088 ("connection: don't auto-negotiate LZ4 from the built-in codec alone") has merged, so this PR no longer waits on anything. Master, including #1115, has been merged into this branch. The unit-test step now reads
uv run --with lz4 --with "pyasyncore; python_version >= '3.12'" coverage run ..., and the comment blocks for both overlays are kept.Summary
The coverage lane builds with
CASS_DRIVER_NO_CYTHON=1, so the Cython-onlycassandra.cython_lz4codec isn't built. Thelz4package is only available through the optionalcompress-lz4extra. As a result, the lane has no lz4 codec at all:cassandra/connection.py(lines 72-101) never runs;tests/unit/test_segment.pyare skipped.This PR adds
--with lz4to the main unit-testuv run coverage runcall inscripts/coverage.sh.uv run --withlayerslz4on top of the project env for that one call only, and leaves the project env itself unchanged, so later steps run without lz4. Coverage still reads the same[tool.coverage]config and writes parallel data files, whichcoverage combinemerges as before.Not changed: the workflow, the dev group,
pyproject.toml, the asyncio reactor step, and the integration step.Why only the unit step
Cluster.compressiondefaults toTrue, and the connection picks the first codec that both the driver and the server support. If lz4 were installed for the whole lane, the ~20-minute integration run would switch to LZ4.With #1088,
compression=Truepicks LZ4 only when thelz4package is installed; otherwise the connection stays uncompressed. That makes LZ4 opt-in, so the integration step should keep measuring the default, uncompressed path that most users get.Unit tests are the right place to cover the lz4 code, including the "lz4 package installed" branch that #1088 adds. The asyncio reactor step doesn't exercise compression (its helpers send
'COMPRESSION': []), so it doesn't get lz4 either.Before / after
Unit-only
scripts/coverage.shon Python 3.13, noSCYLLA_VERSION, measured before the merges described above:test_segment.pyskippedcassandra/connection.pycassandra/segment.pyIn CI (unit + integration), the first run of this PR measured 3232 missed statements, against 3278 on master at the time.
The 7 tests in
tests/unit/cython/test_cython_lz4.pystill skip, as expected, because the Cython codec isn't built in this lane.Verification
scripts/coverage.shon master and on this branch; numbers are in the table above. Both runs exited 0, and the asyncio reactor step passed 2/2 in both.import lz4fails in the project env, so lz4 isn't left behind and the integration step runs without it.bash -npasses.lz4andasyncore(viapyasyncore) both import inside the combined--withoverlay.test_segment.pyandtest_asyncorereactor.pypass together under it (31 passed). CI on the merged head is green.Pre-review checklist
./docs/source/. (N/A;CONTRIBUTING.rstchecked and still accurate)Fixes:annotations to PR description. (N/A)🤖 Generated with Claude Code
https://claude.ai/code/session_01QYcPjKDEQaQTfxpdfsFjZA