Skip to content

test(fabric): cover the identity provider in platform/fabric/core/generic/id - #1850

Merged
SaidAltury-ibm merged 2 commits into
hyperledger-labs:mainfrom
sid200727:test/fabric-id-coverage
Sep 16, 2026
Merged

SaidAltury-ibm merged 2 commits into
hyperledger-labs:mainfrom
sid200727:test/fabric-id-coverage

Conversation

@sid200727

Copy link
Copy Markdown
Contributor

Fixes #1849

Background

The package sat at 56.2% with scripts/filter-coverage.sh applied. info_test.go already covered Info for both an idemix and an x509 identity, but provider.go had no tests at all.

What this covers

provider wraps a single-method EndpointService, so a small stub drives both functions: NewProvider, and Identity for a label that resolves and one whose lookup fails, checking the error names the label that could not be resolved, since that is what makes it useful to a caller.

Also covers Info for an identity neither deserializer understands, which renders as the empty string rather than failing.

Coverage

56.2% → 93.8% (filtered). provider.go is at 100%.

The one remaining line is Info's guard on idemix.NewDeserializer(nil). With an empty issuer public key that constructor skips its key import entirely, so it can only fail if the crypto provider itself does — not reachable from a test.

Testing

Plain testify, no Ginkgo. No production code changed. go vet, gofmt -l and golangci-lint (v2.13.2) all clean.

…eric/id

The package sat at 56.2% with the coverage filter applied. info_test.go
covered Info for an idemix and an x509 identity, but provider.go had no
tests at all.

provider wraps a single-method EndpointService, so a small stub covers
both NewProvider and Identity: a label that resolves, and one whose
lookup fails, checking the error names the label that could not be
resolved.

Also covers Info for an identity neither deserializer understands, which
renders as the empty string.

The package is now at 93.8%. The remaining line is Info's guard on
idemix.NewDeserializer(nil): with an empty issuer public key the
constructor skips its key import entirely, so it can only fail if the
crypto provider itself does.

Fixes hyperledger-labs#1849

Signed-off-by: Siddhi Khandelwal <siddhi.200727@gmail.com>
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Hey @sid200727 👋 thanks for the PR!
I'm your friendly PR Helper Bot 🤖 and I'll be riding shotgun on this one, keeping track of your PR's status to help you get it approved and merged.

This comment updates automatically as you push changes -- think of it as your PR's live scoreboard!
Here's the latest:


PR Checks

✅ DCO Sign-off -- All commits have valid sign-offs. Nice work!


✅ GPG Signature -- All commits have verified GPG signatures. Locked and loaded!


✅ Merge Conflicts -- No merge conflicts detected. Smooth sailing!


✅ Issue Link -- Linked to #1849 (assigned to you).


🎉 All checks passed! Your PR is ready for review. Great job!

@github-actions github-actions Bot added the status: needs revision The pull request requires changes from the author before it can be reviewed or merged label Sep 16, 2026
@mbrandenburger mbrandenburger added this to the 26Q3 milestone Sep 16, 2026
Signed-off-by: Siddhi Khandelwal <siddhi.200727@gmail.com>
@github-actions github-actions Bot added status: needs review The pull request is ready for maintainer review and removed status: needs revision The pull request requires changes from the author before it can be reviewed or merged labels Sep 16, 2026

@SaidAltury-ibm SaidAltury-ibm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify

mergify Bot commented Sep 16, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@SaidAltury-ibm
SaidAltury-ibm merged commit 8ca6e76 into hyperledger-labs:main Sep 16, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs review The pull request is ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(fabric): increase coverage of platform/fabric/core/generic/id

3 participants