Repository navigation
Conversation
Move 223 tests across bytesbuf_io, cachet, cachet_memory, cachet_service, and cachet_tier. Document why 60 private-path tests remain. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Refresh assertions remain nondeterministic, and the telemetry check can pass without verifying the cache.hit event’s severity.
2 open issues
What changed in this PR
This PR moves tests for byte I/O and cache packages toward public APIs, reducing their dependence on internal implementation details. It retains unit tests where public APIs cannot expose the required state.
Changes:
- Moves 223 tests into integration targets across five packages.
- Documents why 60 private-detail tests remain local.
- Reworks refresh and telemetry checks around public operations and removes an unused test-only accessor.
| File | Description |
|---|---|
crates/cachet/src/wrapper.rs |
Removes migrated tests and the test-only name accessor. |
crates/cachet/src/transform/tier.rs |
Retains private adapter checks; removes migrated tests. |
crates/cachet/src/transform/testing.rs |
Documents the private codec fixture boundary. |
crates/cachet/src/telemetry/seismograph.rs |
Explains retained event-encoding tests. |
crates/cachet/src/telemetry/cache.rs |
Removes migrated telemetry tests; documents retained cases. |
crates/cachet/src/telemetry/attributes.rs |
Removes migrated constant checks. |
crates/cachet/src/serialize/codec.rs |
Retains private decode checks; removes migrated cases. |
crates/cachet/src/refresh.rs |
Retains bookkeeping tests; removes migrated refresh cases. |
crates/cachet/src/fallback.rs |
Retains private construction checks; removes public-behavior tests. |
crates/cachet/src/eviction.rs |
Explains retained hook tests. |
crates/cachet/src/cache.rs |
Retains merger checks; removes migrated cache tests. |
crates/cachet/src/builder/transform.rs |
Removes migrated tier-role telemetry test. |
crates/cachet/src/builder/cache.rs |
Retains private hook and naming checks. |
crates/cachet/src/builder/buildable.rs |
Removes migrated nested-fallback role test. |
crates/cachet_tier/tests/public_api.rs |
Adds error, shared-state, and mock-failure tests. |
crates/cachet_tier/src/testing.rs |
Removes migrated mock-failure tests. |
crates/cachet_tier/src/error.rs |
Removes migrated error tests. |
crates/cachet_tier/src/dynamic.rs |
Removes migrated shared-state test. |
crates/cachet_service/tests/public_api.rs |
Adds request, adapter, and extension tests. |
crates/cachet_service/src/request.rs |
Removes migrated request and response tests. |
crates/cachet_service/src/ext.rs |
Removes migrated extension-method tests. |
crates/cachet_service/src/adapter.rs |
Removes migrated adapter tests. |
crates/cachet_memory/tests/public_api.rs |
Adds configuration, policy, and cache-operation tests. |
crates/cachet_memory/src/tier.rs |
Retains backing-state and maintenance tests. |
crates/cachet_memory/src/policy.rs |
Retains private policy-conversion checks. |
crates/cachet_memory/src/notification.rs |
Explains retained removal-cause conversion tests. |
crates/cachet_memory/src/builder.rs |
Retains private callback tests; removes migrated cases. |
crates/bytesbuf_io/tests/public_api.rs |
Adds public read, write, stream, and utility tests. |
crates/bytesbuf_io/src/write_ext.rs |
Removes migrated write-extension tests. |
crates/bytesbuf_io/src/testing/pending.rs |
Removes migrated pending-I/O tests. |
crates/bytesbuf_io/src/testing/null.rs |
Removes migrated null-I/O tests. |
crates/bytesbuf_io/src/testing/fake_write.rs |
Removes migrated fake-writer tests. |
crates/bytesbuf_io/src/testing/fake_read.rs |
Retains the size-limit planner test. |
crates/bytesbuf_io/src/read_futures.rs |
Removes migrated stream-adapter tests. |
crates/bytesbuf_io/src/read_ext.rs |
Removes migrated read-extension tests. |
Review effort: Balanced
Inspect queued refresh tasks without driving the runtime. Check the severity on the cache.hit record rather than unrelated completion logs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mark integration helpers as test code and fix expression and documentation lints without adding suppressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #993 +/- ##
=========================================
Coverage 99.9% 100.0%
=========================================
Files 851 60 -791
Lines 74592 4013 -70579
=========================================
- Hits 74583 4013 -70570
+ Misses 9 0 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Replace catch-all targets with 25 behavior-specific executables. Preserve all 223 migrated cases, feature gates, per-target tracing initialization, and shared refresh completion support. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Evgenii (Vaiz)
approved these changes
Nov 19, 2026
martintmk
enabled auto-merge (squash)
November 19, 2026 16:28
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
This automated mechanical PR moves tests for bytesbuf_io, cachet, cachet_memory, cachet_service, and cachet_tier to dedicated integration targets by behavior area.
Every existing unit test in these five packages was audited. The change moves 223 tests and retains 60 tests for private details.
The migrated cases use 25 dedicated integration targets. There are no catch-all
public_api.rstargets.tests/read_operations,stream_reads,write_operations,fake_read,fake_write,null_io,pending_iocache_operations,cache_builders,telemetry,fallback_operations,transformed_storage,entry_expiration,serialization_contracts,refresh,insert_rejectionconfiguration,eviction_policy,tier_operationsrequests,extensions,service_adapterdynamic_storage,errors,mock_storageTests use existing public builders, traits, test utilities, frozen clocks, and event handlers. No production API seam was added. One unused test-only accessor was removed.
Each cachet executable initializes tracing. The fallback and refresh targets share their completion handler through conventional
mod supportdiscovery. Existing feature and platform conditions remain attached to the migrated cases.Retained tests have source comments explaining their boundaries:
usize::MAX, which cannot use a real public byte buffer.Refresh assertions inspect queued tasks without driving the runtime, or wait for completion events. The hit-severity assertion selects the
cache.hitrecord itself.Motivation
Tests through public APIs depend on observable behavior rather than internal structure. Internal refactoring therefore needs fewer test changes.
Dedicated targets group tests by behavior area. Private-path tests remain local when the supported public API cannot expose their inputs or assertions.
Evidence
After the final layout change, default-feature compilation passed:
All 223 migrated cases passed across the 25 targets, with no failures or ignored tests:
The final scoped Clippy run passed without suppressions:
Formatting used the repository formatter toolchain with package selectors. The layout correction preserves all 223 test attributes. All 283 original unit tests remain accounted for, including the 60 retained private cases.
Full suites, coverage, mutation testing, runtime analysis, and spelling checks were not run locally. CI for the final head is pending.
Merge Danger
The main risk is test coverage drift when private construction becomes public operations. Feature gates and separate integration targets can also change test selection. The all-feature runs exercise every migrated case, but do not prove every feature or platform configuration.
Some assertions now observe public events, operations, or Debug output instead of private fields. CI must still assess coverage and mutation results. This PR does not intentionally change runtime behavior.