• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bedrock-kv / bedrock / 057dac132d2bb9ab0eb9584b42b0e90d8cf3ad6e
73%

Build:
DEFAULT BRANCH: develop
Ran 14 Jul 2026 08:19PM UTC
Jobs 2
Files 215
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Jul 2026 08:18PM UTC coverage: 69.496% (+0.7%) from 68.76%
057dac132d2bb9ab0eb9584b42b0e90d8cf3ad6e

push

github

web-flow
Add behavioral tests for Directory partition operations (bedrock-ej0) (#88)

## Summary
- Adds `directory_partition_test.exs` (28 tests) for `Bedrock.Directory`
(coverage 92.5% → 99.1%)
- Instead of canned Mox expectations, tests run directory operations
end-to-end against an Agent-backed in-memory store that byte-for-byte
mirrors `Bedrock.Repo`'s keyspace pack/get_range semantics — covering
partition-scoped ops, path-escape validation (`..`), create_or_open
flows, accessors, `ToKeyRange`/`ToKeyspace` protocol impls, and all
node-value encoding variants via real round-trips

## Bugs found (audit-confirmed against real modules, tickets filed)
1. **Critical — directory hierarchy scans are blind to descendants
against any real store.** `Encoding.Tuple.pack/1` wraps top-level lists
in a nested-list tag, so a packed node key (`["app"]`) is NOT a
byte-prefix of its child (`["app","users"]`) — diverges at the
list-terminator byte. Consequently non-root `Directory.list` returns
`[]` regardless of children, `remove` orphans descendants, and `move`
misses them. Root works only because `pack([]) = <<>>`. Every existing
directory test masks this with canned `get_range` mocks that return
descendants unconditionally.
2. **`do_move_recursive` crashes against the real repo before the prefix
issue even matters**: it calls `repo.get_range(start_key, end_key)` with
two binaries, which the generated repo parses as `(range, opts)` →
`FunctionClauseError` in `Keyword.get`. Same shape for `clear_range`.

The new tests are deliberately honest about this: they assert only
currently-correct behavior (root list, leaf remove/move) rather than
pinning the broken paths.

## Audit
Independent review reproduced the prefix divergence and range exclusion
by executing lib code directly (no mocks), traced the production
plumbing `do_list` uses, and verified nothing in livebooks/bedrock_ex
exercises non-root hierarchy ops (why it went unnoticed). Store fidelity
verified against `repo.ex`... (continued)

7 of 7 new or added lines in 2 files covered. (100.0%)

1 existing line in 1 file now uncovered.

5445 of 7835 relevant lines covered (69.5%)

1966.02 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
88.28
-0.37% lib/bedrock/data_plane/transaction.ex
Jobs
ID Job ID Ran Files Coverage
1 057dac132d2bb9ab0eb9584b42b0e90d8cf3ad6e.1 14 Jul 2026 08:19PM UTC 215
69.48
GitHub Action Run
2 057dac132d2bb9ab0eb9584b42b0e90d8cf3ad6e.2 14 Jul 2026 08:19PM UTC 215
69.43
GitHub Action Run
Source Files on build 057dac132d2bb9ab0eb9584b42b0e90d8cf3ad6e
  • Tree
  • List 215
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 057dac13 on github
  • Prev Build on develop (#72847101...)
  • Next Build on develop (#C83F2765...)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc