Skip to content

Commit 3ee3e42

Browse files
AlexStocksOmX
andcommitted
Keep CF registry tests inside the workspace lint gate
The registry round-trip test used four bare unwrap calls. CI runs make lint with clippy::unwrap_used denied across every target and feature, so all three platforms rejected the current PR Head before reaching the remaining checks. This decision gives each asserted registry invariant an explicit panic message without changing production behavior or weakening the lint policy. Constraint: Test failures must still identify whether stable-ID conversion, round-trip decoding, put, or delete violated the registry contract. Rejected: Allow clippy::unwrap_used in the test module | The workspace gate intentionally applies the rule to all targets. Confidence: high Scope-risk: narrow Tested: WSL make lint; WSL exact CF registry batch test; cargo fmt --all -- --check; git diff --check. Related: #421 Co-authored-by: OmX <omx@oh-my-codex.dev> Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
1 parent ec09722 commit 3ee3e42

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/storage/src/batch.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,12 @@ mod tests {
587587
for cf_idx in ColumnFamilyIndex::ALL {
588588
assert_eq!(
589589
cf_index_to_usize(cf_idx),
590-
usize::try_from(cf_idx.stable_id()).unwrap()
590+
usize::try_from(cf_idx.stable_id())
591+
.expect("registered stable CF ID should fit usize")
591592
);
592593
assert_eq!(
593-
ColumnFamilyIndex::try_from(cf_idx.stable_id()).unwrap(),
594+
ColumnFamilyIndex::try_from(cf_idx.stable_id())
595+
.expect("registered stable CF ID should round-trip"),
594596
cf_idx
595597
);
596598
}
@@ -599,10 +601,10 @@ mod tests {
599601
let mut batch = BinlogBatch::new(append_log_fn);
600602
batch
601603
.put(ColumnFamilyIndex::VectorDataCF, b"physical-key", b"value")
602-
.unwrap();
604+
.expect("registry wire-ID test should put Vector data");
603605
batch
604606
.delete(ColumnFamilyIndex::ZsetsScoreCF, b"physical-key")
605-
.unwrap();
607+
.expect("registry wire-ID test should delete ZSet score data");
606608
assert_eq!(
607609
batch.entries[0].cf_idx,
608610
ColumnFamilyIndex::VectorDataCF.stable_id()

0 commit comments

Comments
 (0)