-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Increase unit test coverage of credentials/attestation_verifier/
by 3.1%
#40670
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 3.1%
#40670
Conversation
credentials/attestation_verifier/
by 3%credentials/attestation_verifier/
by 3%
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 increases unit test coverage for the credentials/attestation_verifier/
module from 67.9% to 71% by adding comprehensive test cases for certificate and attestation validation in the partial DAC verifier. The tests focus on error scenarios including certificate validity periods, malformed data, and nonce validation.
- Adds tests for expired and future-valid DAC certificates
- Validates handling of malformed attestation elements and nonce mismatches
- Tests PAA certificate format validation failure paths
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/credentials/tests/TestDacOnlyPartialAttestationVerifier.cpp
Outdated
Show resolved
Hide resolved
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 successfully increases unit test coverage for the partial DAC verifier by adding several valuable test cases for certificate and attestation validation. The new tests are well-structured and cover important edge cases.
My review includes a few suggestions to improve maintainability and clarity, such as renaming a misleading variable, replacing magic numbers with sizeof
, and clarifying a nonce value in one of the tests. Additionally, there is an opportunity to reduce code duplication across the new tests by refactoring common setup and signing logic into a shared helper function. Addressing these points will make the new tests even more robust and easier to maintain.
src/credentials/tests/TestDacOnlyPartialAttestationVerifier.cpp
Outdated
Show resolved
Hide resolved
src/credentials/tests/TestDacOnlyPartialAttestationVerifier.cpp
Outdated
Show resolved
Hide resolved
src/credentials/tests/TestDacOnlyPartialAttestationVerifier.cpp
Outdated
Show resolved
Hide resolved
credentials/attestation_verifier/
by 3%credentials/attestation_verifier/
by 3.1%
6168d5a
to
c207fa5
Compare
/gemini-review |
Thank you for requesting a review! I am currently reviewing the pull request and will provide feedback shortly. |
PR #40670: Size comparison from 6e50acf to c207fa5 Full report (36 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nxp, psoc6, qpg, realtek, stm32, telink)
|
c207fa5
to
aa283a8
Compare
PR #40670: Size comparison from a2a07d4 to aa283a8 Full report (36 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nxp, psoc6, qpg, realtek, stm32, telink)
|
840025c
to
ad5b58a
Compare
ad5b58a
to
aa283a8
Compare
aa283a8
to
c741cd8
Compare
PR #40670: Size comparison from 233d3f7 to c741cd8 Full report (5 builds for cc32xx, realtek, stm32)
|
dfdf7fa
to
da501c9
Compare
PR #40670: Size comparison from 233d3f7 to da501c9 Full report (17 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, qpg, realtek, stm32)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #40670 +/- ##
==========================================
+ Coverage 50.78% 50.80% +0.02%
==========================================
Files 1358 1358
Lines 99477 99477
Branches 12877 12868 -9
==========================================
+ Hits 50521 50541 +20
+ Misses 48956 48936 -20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
139e85c
to
19e9069
Compare
PR #40670: Size comparison from 233d3f7 to 19e9069 Full report (36 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nxp, psoc6, qpg, realtek, stm32, telink)
|
19e9069
to
d4324c9
Compare
PR #40670: Size comparison from b31081d to d4324c9 Full report (36 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nxp, psoc6, qpg, realtek, stm32, telink)
|
54d5f4b
to
76e92e4
Compare
PR #40670: Size comparison from f1631b6 to 76e92e4 Full report (36 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nxp, psoc6, qpg, realtek, stm32, telink)
|
- Add test TestWithExpiredDACCertificate - Add test TestWithExpiredDACCertificate
- Add test for malformed attestation elements: TestWithMalformedAttestationElements - Add test for mismatched nonce handling: TestWithMismatchedNonce
…C certificate validation
76e92e4
to
06af551
Compare
PR #40670: Size comparison from 71aed77 to 06af551 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 67.9% to 71% by adding tests for certificate and attestation validation in the partial DAC verifier.The new tests cover the following scenarios:
Related issues
Main issue: #37234
Testing
This PR only adds new unit tests. No changes were made to production code.