Skip to content

Cover reconstruct_descriptor paths that had no test - #924

Merged
kwsantiago merged 1 commit into
mainfrom
frostnet-reconstruct-tests
Jul 30, 2026
Merged

Cover reconstruct_descriptor paths that had no test#924
kwsantiago merged 1 commit into
mainfrom
frostnet-reconstruct-tests

Conversation

@kwsantiago

Copy link
Copy Markdown
Contributor

Summary

Adds three unit tests for reconstruct_descriptor, covering paths that were previously exercised only through a full session or not at all.

A correction is owed here. An audit comment I posted on #790 stated this function had no test. That was wrong: two tests already existed, covering an invalid network string and a missing contribution. The grep behind that claim searched for lines containing both the function name and the word "test", and a test function's own name line contains neither the attribute nor the word, so it returned nothing. The function was never untested, and the item as written should not be closed on the basis I originally gave.

What was genuinely uncovered, and is covered here:

  • A contribution that is present but not a usable extended key, so it passes the session-level prefix check and then fails at conversion. This is the only test that reaches the conversion error path.
  • An external key slot, which carries its own key and must never be looked up in the contributions map. The test supplies no contributions at all and asserts the failure does not come from a lookup, so a regression that treated external slots as participants would fail rather than pass for the wrong reason.
  • A policy with no recovery tiers, which takes the branch that builds no recovery configuration at all. This is the only success-path test, and it asserts the receive and change descriptors differ, since returning the same string twice would otherwise satisfy a weaker check.

The two pre-existing tests are left alone. Two further tests I initially wrote were dropped before pushing because they duplicated those.

Test plan

cargo test -p keep-frost-net --lib reconstruct passes: 5 tests, the 2 existing and the 3 added. cargo fmt --check clean.

The new tests use placeholder extended keys in the same style as the surrounding tests. That is deliberate for the two error-path cases, which need a value that is well-formed enough to pass validation and not decodable. Note this means the conversion-failure test would still pass if conversion began rejecting for a different reason, so it pins the error path rather than the specific cause.

Part of #790.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kwsantiago, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d742649-6171-43a4-9010-68d413ee0df5

📥 Commits

Reviewing files that changed from the base of the PR and between b8bef42 and f81f367.

📒 Files selected for processing (1)
  • keep-frost-net/src/descriptor_session.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kwsantiago
kwsantiago merged commit 4b0ffa2 into main Jul 30, 2026
10 checks passed
@kwsantiago
kwsantiago deleted the frostnet-reconstruct-tests branch July 30, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant