-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Increase unit test coverage of credentials/attestation_verifier/
by 16.7%
#40702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Increase unit test coverage of credentials/attestation_verifier/
by 16.7%
#40702
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive unit tests for the device attestation verifier module to increase test coverage from 71% to 87.7%. The tests focus on verifying default stub behavior, field copying functionality, error handling, and description mapping.
Key changes:
- Added complete test coverage for unimplemented verifier stub methods
- Added validation tests for attestation info field copying into device info structures
- Added comprehensive testing of error description mapping for all enum values
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
TestDeviceAttestationVerifier.cpp | New comprehensive test file covering default verifier stubs, field copying, null handling, and error descriptions |
BUILD.gn | Added the new test file to the build configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request significantly increases the unit test coverage for the credentials/attestation_verifier/
directory by adding a new test file with comprehensive tests for default verifier stubs, data copying, and error handling. The new tests are well-structured and cover a good range of scenarios. I have one suggestion to improve the code by using the idiomatic data_equal
method for ByteSpan
comparisons, which enhances readability and safety.
62bc960
to
397e1ef
Compare
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request significantly increases unit test coverage for the credentials/attestation_verifier/
directory by adding a new suite of tests. The new tests are well-structured and cover the intended scenarios, such as default verifier stub behavior, data copying in AttestationInfo
, and error handling logic. The changes are a valuable addition to the codebase. I have one suggestion to improve the robustness of a test case to prevent a potential memory safety issue if the test is extended in the future.
019544b
to
755e82a
Compare
PR #40702: Size comparison from c2f7ddb to 755e82a Full report (36 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nxp, psoc6, qpg, realtek, stm32, telink)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #40702 +/- ##
==========================================
+ Coverage 50.78% 50.90% +0.11%
==========================================
Files 1358 1358
Lines 99477 99487 +10
Branches 12877 12875 -2
==========================================
+ Hits 50521 50639 +118
+ Misses 48956 48848 -108 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
755e82a
to
13eb5a8
Compare
PR #40702: Size comparison from f1631b6 to 13eb5a8 Full report (36 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nxp, psoc6, qpg, realtek, stm32, telink)
|
- Added UnimplementedDACVerifierStub test - Added AttestationDeviceInfoCopiesFields test - Added SetDeviceAttestationVerifierNullptrArgument test - Added AttestationResultDescription test - Added SetRevocationDelegate test - Integrated the file into the build
13eb5a8
to
73f85d0
Compare
PR #40702: Size comparison from 71aed77 to 73f85d0 Full report (36 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nxp, psoc6, qpg, realtek, stm32, telink)
|
Summary
This PR increases
credentials/attestation_verifier/
unit test coverage from 71% to 87.7% by adding additional unit tests that verify the behavior of default verifier stubs, object field initialization, and error description logic.The new tests cover the following scenarios:
AttestationVerificationResult
enum value maps to a human-readable string description, and verifies the fallback description for unknown enum values.Related issues
Main issue: #37234
Testing
This PR only adds new unit tests. No changes were made to production code.