Skip to content

test: increase test coverage by 16% across 3 crates#970

Open
Nuel-osas wants to merge 1 commit intoiotaledger:developfrom
Nuel-osas:test/increase-coverage-bounty-504
Open

test: increase test coverage by 16% across 3 crates#970
Nuel-osas wants to merge 1 commit intoiotaledger:developfrom
Nuel-osas:test/increase-coverage-bounty-504

Conversation

@Nuel-osas
Copy link
Contributor

Summary

Adds 387 unit tests across 16 files in 3 crates, increasing line coverage from 47.84% to 64.08% (+16.24%).

Targets meaningful logic rather than trivial getters:

  • iota-sdk-types (+178 tests): ZkLogin claim verification (verify_extended_claim, JwtHeader::from_base64, ZkLoginInputs::new), passkey authenticator validation & serialization roundtrips, MoveAuthenticator construction/address extraction/serialization, MultisigCommittee is_valid() validation, Bn254FieldElement encoding, event/object types
  • iota-sdk-transaction-builder (+138 tests): TransactionBuilder API (gas config, commands, send_coins), ULEB128 encoding & MoveArgCollection BCS serialization, gas station version parsing, unresolved transaction types, error variants
  • iota-sdk-graphql-client (+71 tests): TryFrom<BigInt> for u64 conversion with overflow/error cases, pagination utilities (Page::map, into_parts), error type system, faucet types, stream helpers

All tests are fully offline and self-contained. See TEST_COVERAGE.md for detailed breakdown.

Closes #504

Test plan

  • cargo +nightly test -p iota-sdk-types --lib --all-features — 536 passed, 0 failed
  • cargo +nightly test -p iota-sdk-transaction-builder --lib — 139 passed, 8 failed (pre-existing, require localnet)
  • cargo +nightly test -p iota-sdk-graphql-client --lib — 75 passed, 32 failed (pre-existing, require GraphQL endpoint)
  • Coverage measured with cargo-llvm-cov: 47.84% → 64.08%

Add comprehensive unit tests targeting meaningful logic across
iota-sdk-types, iota-sdk-transaction-builder, and iota-sdk-graphql-client.
Line coverage increases from 47.84% to 64.08% (+16.24%).

Key areas tested:
- ZkLogin claim verification, JWT header parsing, Bn254FieldElement encoding
- Passkey authenticator validation and serialization roundtrips
- MoveAuthenticator construction, address extraction, serialization
- ULEB128 encoding and MoveArgCollection BCS serialization
- TransactionBuilder API, gas configuration, and command generation
- BigInt-to-u64 conversion with overflow/error handling
- Gas station version parsing and comparison
- Pagination utilities, error types, faucet types, stream helpers
- MultisigCommittee is_valid() validation logic
- Unresolved transaction types and error variants

All 387 new tests are fully offline and self-contained.
@Nuel-osas Nuel-osas requested a review from a team as a code owner February 18, 2026 09:14
@thibault-martinez
Copy link
Member

FYI this is a global bump of 3.3%
image

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.

[Bounty] Increase test coverage by 5%

2 participants