-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Increase unit test code coverage of controller
by 0.2%
#40693
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?
Conversation
PR #40693: Size comparison from 233d3f7 to bedd974 Full report (2 builds for realtek)
|
PR #40693: Size comparison from 233d3f7 to 97aac87 Full report (5 builds for cc32xx, realtek, stm32)
|
PR #40693: Size comparison from 233d3f7 to d298e75 Full report (4 builds for cc32xx, nrfconnect, stm32)
|
PR #40693: Size comparison from 233d3f7 to 92aef49 Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, 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 #40693 +/- ##
=======================================
Coverage 50.78% 50.79%
=======================================
Files 1358 1358
Lines 99477 99477
Branches 12877 12875 -2
=======================================
+ Hits 50521 50530 +9
+ Misses 48956 48947 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
92aef49
to
0610e10
Compare
PR #40693: Size comparison from b31081d to 0610e10 Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
PR #40693: Size comparison from b31081d to 20c0b26 Full report (5 builds for cc32xx, realtek, stm32)
|
6e8c664
to
7bd887e
Compare
PR #40693: Size comparison from c2f7ddb to 7bd887e Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
7bd887e
to
e302ece
Compare
PR #40693: Size comparison from fcf3436 to e302ece Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
e302ece
to
04bc19a
Compare
PR #40693: Size comparison from 71aed77 to 04bc19a Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Summary
This PR adds 4 new test cases to
TestAutoCommissioner.cpp
to improve test coverage of the NOC chain generation failure paths flows in theNOCChainGenerated
function.The new tests verify that
NOCChainGenerated
function correctly handles invalid arguments by:Rejecting an empty ByteSpan for the RCAC certificate.
Rejecting an empty ByteSpan for the NOC when a valid RCAC is provided.
Rejecting an RCAC ByteSpan with a corrupted (oversized) length.
Rejecting a NOC ByteSpan with a corrupted (oversized) length.
Implementation Notes
Testing of the private
NOCChainGenerated
function is accomplished via aAutoCommissionerTestAccess
class, in accordance with the testing guidelines defined in the Connected Home IP unit testing documentation.The happy path for this function (i.e., successfully calling PerformCommissioningStep with valid RCAC, NOC, and ICAC arguments) is thoroughly covered by this Python integration test
src/controller/python/OpCredsBinding.cpp
. These C++ unit tests therefore focus exclusively on the failure paths, which are not covered by the integration tests.Unit testing the happy path for NOCChainGenerated is impractical as it requires significant hierarchical object initialization (e.g., fully configured DeviceCommissioner and CommissioneeDeviceProxy objects). Mocking is difficult due to deleted default constructors, and the resulting test would become unnecessarily complex and integration-like.
Related issues
Fixes: #37233
Testing
This PR adds new unit tests and NOC chain certificates generated using the chip-cert tool is accordance of Working with the CHIP Tool guidance in result adding No change to production code.
Local (Linux) Coverage Impact of
/controller
Local (Linux) Coverage Impact of
/AutoCommissioner.cpp