Repository navigation
test(fabric): cover the identity provider in platform/fabric/core/generic/id - #1850
Merged
SaidAltury-ibm merged 2 commits intoSep 16, 2026
Merged
Conversation
…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>
|
Hey @sid200727 👋 thanks for the PR! This comment updates automatically as you push changes -- think of it as your PR's live scoreboard! 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! |
Signed-off-by: Siddhi Khandelwal <siddhi.200727@gmail.com>
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1849
Background
The package sat at 56.2% with
scripts/filter-coverage.shapplied.info_test.goalready coveredInfofor both an idemix and an x509 identity, butprovider.gohad no tests at all.What this covers
providerwraps a single-methodEndpointService, so a small stub drives both functions:NewProvider, andIdentityfor 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
Infofor an identity neither deserializer understands, which renders as the empty string rather than failing.Coverage
56.2% → 93.8% (filtered).
provider.gois at 100%.The one remaining line is
Info's guard onidemix.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 -landgolangci-lint(v2.13.2) all clean.