test(rocksdb): re-enable test_open_rocksdict with a faithful rocksdict mock#720
Merged
Conversation
…t mock
The test was skipped ("Need to make mock BlockBasedOptions") because it
patched only `faust.stores.rocksdb.rocksdict` -- the store's rocksdict path
also uses the bare module-level `Options`/`DB` names, so `Options(raw_mode=True)`
hit the real object and raised "Options() takes no arguments" (rocksdict is
not installed in CI).
Mock the external rocksdict surface (Options, DB, BlockBasedOptions, Cache,
ReadOptions, BlockBasedIndexType) and assert the store drives it correctly --
Options(raw_mode=True), create_if_missing, the field-driven setters, the
block-based table factory, DB(path, options=..., access_type=...), and
set_read_options. Only the external library is mocked; open()/as_options()
run for real. Assertions are strictly stronger than the stale original.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #720 +/- ##
==========================================
+ Coverage 94.18% 94.36% +0.17%
==========================================
Files 104 104
Lines 11154 11154
Branches 1202 1202
==========================================
+ Hits 10505 10525 +20
+ Misses 548 530 -18
+ Partials 101 99 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
wbarnha
enabled auto-merge
July 21, 2026 11:13
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.
Description
Re-enables
TestRocksDBOptions::test_open_rocksdict, skipped as "Need to make mock BlockBasedOptions".The test patched only
faust.stores.rocksdb.rocksdict, but the store'suse_rocksdictpath also uses the bare module-levelOptions/DBnames, soOptions(raw_mode=True)reached the real object and raisedTypeError: Options() takes no arguments(rocksdictisn't installed in CI).Fix (test-only): mock the full external
rocksdictsurface used by the store —Options,DB,BlockBasedOptions,Cache,ReadOptions,BlockBasedIndexType— and assert the store drives it correctly:Options(raw_mode=True),create_if_missing(True), the field-driven setters (max_open_files,write_buffer_size, …), the block-based table factory (bloom filter, block cache, binary-search index),DB(str(path), options=…, access_type=…), andset_read_options. Only the external library is mocked;open()/as_options()run for real. Assertions are strictly stronger than the stale original.Verification
tests/unit/stores/test_rocksdb.py→ 96 passed; flake8/black/isort clean. Fix was produced under adversarial faithfulness review (confirmed no gutted assertions, mocks stand in only for the external lib).🤖 Generated with Claude Code
Generated by Claude Code