Skip to content

test(drive): improve identity key fetch, prove, and queries coverage#3442

Merged
QuantumExplorer merged 1 commit into
v3.1-devfrom
test/drive-identity-key-coverage
Apr 7, 2026
Merged

test(drive): improve identity key fetch, prove, and queries coverage#3442
QuantumExplorer merged 1 commit into
v3.1-devfrom
test/drive-identity-key-coverage

Conversation

@QuantumExplorer
Copy link
Copy Markdown
Member

@QuantumExplorer QuantumExplorer commented Apr 7, 2026

Summary

Adds 54 tests across 4 files in rs-drive identity key module, targeting the lowest-coverage areas.

File New Tests Coverage Before What's covered
key/queries.rs 4 0% fetch_identities_all_keys_query for single/multiple/empty IDs
key/fetch/mod.rs 37 59% All IdentityKeysRequest constructors, into_path_query for every variant, processing_cost, helper conversion functions
key/prove/prove_identity_keys/mod.rs 3 41% Prove with AllKeys, SpecificKeys, LatestAuthenticationMasterKey
key/prove/prove_identities_all_keys/mod.rs 3 Single/multiple identity proving with limit

Test plan

  • cargo test -p drive --lib -- identity::key passes
  • cargo fmt --all clean
  • CI

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added comprehensive test coverage for identity key operations, including fetching, proving, and querying functionality across various request types and scenarios.

Add unit tests targeting the lowest-coverage areas in
packages/rs-drive/src/drive/identity/key/:

- queries.rs (0% -> covered): test fetch_identities_all_keys_query with
  single/multiple identity IDs, empty slice, and limit parameter
- fetch/mod.rs (59% -> improved): test all IdentityKeysRequest constructors,
  into_path_query for every KeyRequestType variant, processing_cost for all
  branches, helper functions (element_to_identity_public_key, etc.),
  IdentityPublicKeyResult trait impls, and integration tests for fetch with
  various result types (KeyIDHashSet, KeyIDVec, SerializedKeyVec)
- prove/ (41% -> improved): test prove_identity_keys and
  prove_identities_all_keys with all-keys, specific-keys, and
  latest-auth-master-key request types

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added this to the v3.1.0 milestone Apr 7, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 766b4f5e-87d3-4c2b-928c-c8765c4c49eb

📥 Commits

Reviewing files that changed from the base of the PR and between e4efd88 and 93c4970.

📒 Files selected for processing (4)
  • packages/rs-drive/src/drive/identity/key/fetch/mod.rs
  • packages/rs-drive/src/drive/identity/key/prove/prove_identities_all_keys/mod.rs
  • packages/rs-drive/src/drive/identity/key/prove/prove_identity_keys/mod.rs
  • packages/rs-drive/src/drive/identity/key/queries.rs

📝 Walkthrough

Walkthrough

This PR adds comprehensive unit and integration test coverage across four identity key management modules, validating request constructors, path/query structures, processing costs, fetch operations, and proof generation with various configuration scenarios.

Changes

Cohort / File(s) Summary
Identity Keys Fetch Tests
packages/rs-drive/src/drive/identity/key/fetch/mod.rs
Added 862 lines of tests covering IdentityKeysRequest constructor helpers for all key types, into_path_query output structure validation, processing_cost correctness across request types, element-to-public-key conversions, and integration tests for drive.fetch_identity_keys with KeyIDHashSet, KeyIDVec, and SerializedKeyVec result types.
Identity Keys Prove Tests
packages/rs-drive/src/drive/identity/key/prove/prove_identities_all_keys/mod.rs, packages/rs-drive/src/drive/identity/key/prove/prove_identity_keys/mod.rs
Added 240 lines across two modules with unit tests verifying Drive::prove_identities_all_keys and Drive::prove_identity_keys with single/multiple identity configurations, various query request types, limit parameters, and assertion of non-empty proof generation.
Identity Keys Query Tests
packages/rs-drive/src/drive/identity/key/queries.rs
Added 71 lines of tests validating Drive::fetch_identities_all_keys_query construction for single and multiple identities, error handling for empty identity slices, and limit parameter propagation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 With tests we hop and skip with glee,
Identity keys now verified, you see!
Each function proved from end to start,
Coverage grows, a rabbit's art!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding test coverage for identity key fetch, prove, and queries functionality in the drive module.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/drive-identity-key-coverage

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 and usage tips.

@thepastaclaw
Copy link
Copy Markdown
Collaborator

thepastaclaw commented Apr 7, 2026

Review Gate

Commit: 93c4970e

  • Debounce: 4m ago (need 30m)

  • CI checks: checks still running (4 pending)

  • CodeRabbit review: comment found

  • Off-peak hours: peak window (5am-11am PT) — currently 06:55 AM PT Tuesday

  • Run review now (check to override)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 98.22785% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.17%. Comparing base (8a83981) to head (93c4970).
⚠️ Report is 7 commits behind head on v3.1-dev.

Files with missing lines Patch % Lines
...kages/rs-drive/src/drive/identity/key/fetch/mod.rs 98.48% 9 Missing ⚠️
...ackages/rs-drive/src/drive/identity/key/queries.rs 88.88% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           v3.1-dev    #3442      +/-   ##
============================================
+ Coverage     80.66%   81.17%   +0.51%     
============================================
  Files          2852     2852              
  Lines        285371   290349    +4978     
============================================
+ Hits         230190   235689    +5499     
+ Misses        55181    54660     -521     
Components Coverage Δ
dpp 74.38% <ø> (+1.09%) ⬆️
drive 83.06% <98.22%> (+0.56%) ⬆️
drive-abci 86.70% <ø> (ø)
sdk 36.55% <ø> (ø)
dapi-client 79.06% <ø> (ø)
platform-version ∅ <ø> (∅)
platform-value 92.00% <ø> (+1.21%) ⬆️
platform-wallet 76.09% <ø> (ø)
drive-proof-verifier 55.26% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@QuantumExplorer QuantumExplorer merged commit dbc2bdf into v3.1-dev Apr 7, 2026
41 checks passed
@QuantumExplorer QuantumExplorer deleted the test/drive-identity-key-coverage branch April 7, 2026 14:04
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.

2 participants