Skip to content

Conversation

@j-ororke
Copy link
Contributor

@j-ororke j-ororke commented Sep 17, 2025

Summary

Automatically dump device attribute data when composition tests fail to improve debugging efficiency.
Previously, when conformance tests like TC_DeviceConformance or TC_DeviceBasicComposition failed, developers had to manually run IDM-12.1 to collect device attribute dumps for debugging. This PR adds automatic device data logging on test failure by:

  • Moving log_structured_data() to module level in basic_composition.py for reusability
  • Adding teardown_class() override in BasicCompositionTests base class to automatically dump device data when problems are detected
  • Changing inheritance order in TC_DeviceConformance and TC_DeviceBasicComposition from (MatterBaseTest, BasicCompositionTests) to (BasicCompositionTests, MatterBaseTest) to ensure the override takes precedence in Python's Method Resolution Order
  • Adding fail_current_test() override as a fallback for explicit test failures

The structured logs use clear begin/end markers making it easy to extract device data from test failure logs, eliminating the manual step of requesting IDM-12.1 dumps and significantly speeding up the debugging process.

Note: Currently applies to TC_DeviceConformance and TC_DeviceBasicComposition. Other composition test classes (TC_DA_1_2, TC_AccessChecker, TC_IDM_2_2, etc.) would need similar inheritance order changes to inherit this behavior.

Related issues

Resolves task: 680

Testing

  • Verified by composition tests (TC_DeviceConformance, TC_DeviceBasicComposition, TC_DA_1_2, TC_AccessChecker, etc.)

Readability checklist

- Move log_structured_data to module level in basic_composition support module for reusability
- Add on_fail override in BasicCompositionTests to automatically dump device data
- Ensures all composition tests automatically log device attributes on failure
- Improves debugging by providing IDM-12.1 equivalent data without manual intervention
- Add missing logging import to TC_DeviceConformance.py
@j-ororke j-ororke self-assigned this Sep 17, 2025
@github-actions github-actions bot added the tests label Sep 17, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 effectively adds automatic device attribute dumping on composition test failures, which will significantly improve debugging. The approach of moving log_structured_data to a shared module and using an on_fail hook in the base test class is clean and reusable. I have one suggestion to improve code cleanliness by removing a couple of unused imports.

@github-actions
Copy link

PR #41020: Size comparison from a05e91d to e2154ab

Full report (1 build for stm32)
platform target config section a05e91d5 e2154ab change % change
stm32 light STM32WB5MM-DK FLASH 467724 467724 0 0.0
RAM 141400 141400 0 0.0

- Remove on_fail() override as it's now inherited from BasicCompositionTests
- Remove unused log_structured_data import
@github-actions
Copy link

PR #41020: Size comparison from a05e91d to 9c36c19

Full report (1 build for stm32)
platform target config section a05e91d5 9c36c19 change % change
stm32 light STM32WB5MM-DK FLASH 467724 467724 0 0.0
RAM 141400 141400 0 0.0

@github-actions
Copy link

github-actions bot commented Sep 17, 2025

PR #41020: Size comparison from a05e91d to 5edf777

Full report (31 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section a05e91d5 5edf777 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1104392 1104392 0 0.0
RAM 178970 178970 0 0.0
bl702 lighting-app bl702+eth FLASH 658958 658958 0 0.0
RAM 135025 135025 0 0.0
bl702+wifi FLASH 835026 835026 0 0.0
RAM 124509 124509 0 0.0
bl706+mfd+rpc+littlefs FLASH 1068036 1068036 0 0.0
RAM 117333 117333 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 898276 898276 0 0.0
RAM 105676 105676 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 981188 981188 0 0.0
RAM 109828 109828 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 768028 768028 0 0.0
RAM 103392 103392 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 779656 779656 0 0.0
RAM 108560 108560 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 725236 725236 0 0.0
RAM 96932 96932 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 709712 709712 0 0.0
RAM 97140 97140 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552970 552970 0 0.0
RAM 205168 205168 0 0.0
lock CC3235SF_LAUNCHXL FLASH 585694 585694 0 0.0
RAM 205400 205400 0 0.0
esp32 all-clusters-app c3devkit DRAM 102592 102592 0 0.0
FLASH 1775748 1775748 0 0.0
IRAM 83862 83862 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 914684 914684 0 0.0
RAM 152960 152960 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1665436 1665436 0 0.0
RAM 211328 211328 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1585012 1585012 0 0.0
RAM 208592 208592 0 0.0
light cy8ckit_062s2_43012 FLASH 1454876 1454876 0 0.0
RAM 197248 197248 0 0.0
lock cy8ckit_062s2_43012 FLASH 1487204 1487204 0 0.0
RAM 224968 224968 0 0.0
qpg lighting-app qpg6200+debug FLASH 831224 831224 0 0.0
RAM 127788 127788 0 0.0
lock-app qpg6200+debug FLASH 768276 768276 0 0.0
RAM 118748 118748 0 0.0
realtek light-switch-app rtl8777g FLASH 703464 703464 0 0.0
RAM 106660 106660 0 0.0
lighting-app rtl8777g FLASH 755224 755224 0 0.0
RAM 127040 127040 0 0.0
stm32 light STM32WB5MM-DK FLASH 467724 467724 0 0.0
RAM 141400 141400 0 0.0
telink bridge-app tl7218x FLASH 708696 708696 0 0.0
RAM 91388 91388 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 797922 797922 0 0.0
RAM 41960 41960 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 789136 789136 0 0.0
RAM 94604 94604 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 715338 715338 0 0.0
RAM 52188 52188 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 748644 748644 0 0.0
RAM 71236 71236 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725484 725484 0 0.0
RAM 34936 34936 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603348 603348 0 0.0
RAM 107396 107396 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 821758 821762 4 0.0
RAM 93000 93000 0 0.0

@codecov
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.01%. Comparing base (43c9fb4) to head (530ac3a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #41020   +/-   ##
=======================================
  Coverage   51.01%   51.01%           
=======================================
  Files        1386     1386           
  Lines      100988   100988           
  Branches    13081    13081           
=======================================
+ Hits        51519    51520    +1     
+ Misses      49469    49468    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

j-ororke and others added 2 commits September 17, 2025 04:42
… composition test failures

- Change TC_DeviceConformance from (MatterBaseTest, DeviceConformanceTests) to (DeviceConformanceTests, MatterBaseTest)
- Change TC_DeviceBasicComposition from (MatterBaseTest, BasicCompositionTests) to (BasicCompositionTests, MatterBaseTest)
- This ensures BasicCompositionTests.teardown_class() takes precedence in Method Resolution Order
- Enables automatic device attribute dumps when composition tests detect problems
- Improves debugging efficiency by providing IDM-12.1 equivalent data without manual intervention

The inheritance order change allows the teardown_class override in BasicCompositionTests
to execute before MatterBaseTest.teardown_class, ensuring device data is dumped before
the standard problem logging occurs.
@j-ororke j-ororke changed the title [Debug] Add automatic device attribute dump on composition test failures: [Debug] Add automatic device attribute dump on composition test failures Sep 17, 2025
@github-actions
Copy link

PR #41020: Size comparison from a05e91d to 9abde9b

Full report (1 build for stm32)
platform target config section a05e91d5 9abde9b change % change
stm32 light STM32WB5MM-DK FLASH 467724 467724 0 0.0
RAM 141400 141400 0 0.0

@github-actions
Copy link

github-actions bot commented Sep 17, 2025

PR #41020: Size comparison from a05e91d to 6756ca7

Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section a05e91d5 6756ca7 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1104392 1104392 0 0.0
RAM 178970 178970 0 0.0
bl702 lighting-app bl702+eth FLASH 658958 658958 0 0.0
RAM 135025 135025 0 0.0
bl702+wifi FLASH 835026 835026 0 0.0
RAM 124509 124509 0 0.0
bl706+mfd+rpc+littlefs FLASH 1068036 1068036 0 0.0
RAM 117333 117333 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 898276 898276 0 0.0
RAM 105676 105676 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 981188 981188 0 0.0
RAM 109828 109828 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 768028 768028 0 0.0
RAM 103392 103392 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 779656 779656 0 0.0
RAM 108560 108560 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 725236 725236 0 0.0
RAM 96932 96932 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 709712 709712 0 0.0
RAM 97140 97140 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552970 552970 0 0.0
RAM 205168 205168 0 0.0
lock CC3235SF_LAUNCHXL FLASH 585694 585694 0 0.0
RAM 205400 205400 0 0.0
efr32 lock-app BRD4187C FLASH 959624 959624 0 0.0
RAM 126408 126408 0 0.0
BRD4338a FLASH 754960 754960 0 0.0
RAM 255732 255732 0 0.0
window-app BRD4187C FLASH 1053764 1053756 -8 -0.0
RAM 122604 122604 0 0.0
esp32 all-clusters-app c3devkit DRAM 102592 102592 0 0.0
FLASH 1775748 1775748 0 0.0
IRAM 83862 83862 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 914684 914684 0 0.0
RAM 152960 152960 0 0.0
nxp contact mcxw71+release FLASH 690400 690400 0 0.0
RAM 61640 61640 0 0.0
lighting mcxw71+release FLASH 722208 722208 0 0.0
RAM 68308 68308 0 0.0
lock mcxw71+release FLASH 769008 769008 0 0.0
RAM 62004 62004 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1665436 1665436 0 0.0
RAM 211328 211328 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1585012 1585012 0 0.0
RAM 208592 208592 0 0.0
light cy8ckit_062s2_43012 FLASH 1454876 1454876 0 0.0
RAM 197248 197248 0 0.0
lock cy8ckit_062s2_43012 FLASH 1487204 1487204 0 0.0
RAM 224968 224968 0 0.0
qpg lighting-app qpg6200+debug FLASH 831224 831224 0 0.0
RAM 127788 127788 0 0.0
lock-app qpg6200+debug FLASH 768276 768276 0 0.0
RAM 118748 118748 0 0.0
realtek light-switch-app rtl8777g FLASH 703464 703464 0 0.0
RAM 106660 106660 0 0.0
lighting-app rtl8777g FLASH 755224 755224 0 0.0
RAM 127040 127040 0 0.0
stm32 light STM32WB5MM-DK FLASH 467724 467724 0 0.0
RAM 141400 141400 0 0.0
telink bridge-app tl7218x FLASH 708696 708696 0 0.0
RAM 91388 91388 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 797922 797922 0 0.0
RAM 41960 41960 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 789136 789136 0 0.0
RAM 94604 94604 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 715338 715338 0 0.0
RAM 52188 52188 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 748644 748644 0 0.0
RAM 71236 71236 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725484 725484 0 0.0
RAM 34936 34936 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603348 603348 0 0.0
RAM 107396 107396 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 821758 821762 4 0.0
RAM 93000 93000 0 0.0

@j-ororke j-ororke requested a review from cecille September 18, 2025 15:49
Restoring fail_current_test() as per Cecille's suggestion, thank you!
Updated to using module-level logger instance instead of using logging directly
@mergify mergify bot added the conflict label Sep 24, 2025
@mergify mergify bot removed the conflict label Sep 24, 2025
@github-actions
Copy link

github-actions bot commented Sep 24, 2025

PR #41020: Size comparison from 3d8bebe to b149ff6

Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 3d8bebe b149ff6 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1104022 1104022 0 0.0
RAM 178658 178658 0 0.0
bl702 lighting-app bl702+eth FLASH 658590 658590 0 0.0
RAM 134729 134729 0 0.0
bl702+wifi FLASH 834914 834914 0 0.0
RAM 124197 124197 0 0.0
bl706+mfd+rpc+littlefs FLASH 1067872 1067872 0 0.0
RAM 117045 117045 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 898092 898092 0 0.0
RAM 105380 105380 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 980768 980768 0 0.0
RAM 109540 109540 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 767800 767800 0 0.0
RAM 103128 103128 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 779428 779428 0 0.0
RAM 108288 108288 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 725708 725708 0 0.0
RAM 97220 97220 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 710176 710176 0 0.0
RAM 97436 97436 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552814 552814 0 0.0
RAM 204904 204904 0 0.0
lock CC3235SF_LAUNCHXL FLASH 585442 585442 0 0.0
RAM 205136 205136 0 0.0
efr32 lock-app BRD4187C FLASH 959568 959568 0 0.0
RAM 126148 126148 0 0.0
BRD4338a FLASH 755024 755024 0 0.0
RAM 255456 255456 0 0.0
window-app BRD4187C FLASH 1053620 1053620 0 0.0
RAM 122344 122344 0 0.0
esp32 all-clusters-app c3devkit DRAM 102936 102936 0 0.0
FLASH 1777704 1777704 0 0.0
IRAM 83862 83862 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 916216 916216 0 0.0
RAM 153306 153306 0 0.0
nxp contact mcxw71+release FLASH 690048 690048 0 0.0
RAM 61376 61376 0 0.0
lighting mcxw71+release FLASH 721904 721904 0 0.0
RAM 68036 68036 0 0.0
lock mcxw71+release FLASH 768704 768704 0 0.0
RAM 61740 61740 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1667348 1667348 0 0.0
RAM 212980 212980 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1587012 1587012 0 0.0
RAM 210252 210252 0 0.0
light cy8ckit_062s2_43012 FLASH 1454508 1454508 0 0.0
RAM 196984 196984 0 0.0
lock cy8ckit_062s2_43012 FLASH 1486852 1486852 0 0.0
RAM 224704 224704 0 0.0
qpg lighting-app qpg6200+debug FLASH 833568 833568 0 0.0
RAM 127512 127512 0 0.0
lock-app qpg6200+debug FLASH 770612 770612 0 0.0
RAM 118488 118488 0 0.0
realtek light-switch-app rtl8777g FLASH 703872 703872 0 0.0
RAM 106692 106692 0 0.0
lighting-app rtl8777g FLASH 755048 755048 0 0.0
RAM 127040 127040 0 0.0
stm32 light STM32WB5MM-DK FLASH 467500 467500 0 0.0
RAM 141128 141128 0 0.0
telink bridge-app tl7218x FLASH 709816 709816 0 0.0
RAM 91184 91184 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 797680 797680 0 0.0
RAM 41736 41736 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 788894 788894 0 0.0
RAM 94380 94380 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 715700 715700 0 0.0
RAM 52556 52556 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 749006 749006 0 0.0
RAM 71604 71604 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725846 725846 0 0.0
RAM 35304 35304 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603106 603106 0 0.0
RAM 107172 107172 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 821516 821520 4 0.0
RAM 92776 92776 0 0.0

self.xml_device_types, problems = build_xml_device_types(dm)
self.problems.extend(problems)

def teardown_class(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work? The basic information / composition tests do that double-inheritance thing. I was thinking this would happen on the MatterBaseTest teardown.

Though we can actually do proper inheritance now, so if you want to change this, that could make sense too.

Copy link
Contributor Author

@j-ororke j-ororke Oct 1, 2025

Choose a reason for hiding this comment

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

Hey Cecille,

You're totally right - I was overcomplicating this with the inheritance gymnastics! 😅

I've now moved the device attribute dumping functionality from BasicCompositionTests.teardown_class() into MatterBaseTest.teardown_class() where it feels like it belongs more.
This way:

  • No more multiple inheritance headaches
  • All Matter tests get the debugging goodness automatically
  • Much cleaner code that follows proper inheritance patterns
  • Everything still works exactly as before

Thanks for steering me in the right direction! The device dumps will now help debug failures across the entire test suite, not just the composition tests.

Much appreciated!

@github-actions
Copy link

github-actions bot commented Oct 1, 2025

PR #41020: Size comparison from 60d7fa3 to 855d881

Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 60d7fa3 855d881 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1104336 1104336 0 0.0
RAM 178698 178698 0 0.0
bl702 lighting-app bl702+eth FLASH 658780 658780 0 0.0
RAM 134761 134761 0 0.0
bl702+wifi FLASH 834848 834848 0 0.0
RAM 124245 124245 0 0.0
bl706+mfd+rpc+littlefs FLASH 1067858 1067858 0 0.0
RAM 117093 117093 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 898078 898078 0 0.0
RAM 105412 105412 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 980754 980754 0 0.0
RAM 109572 109572 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 768092 768092 0 0.0
RAM 103152 103152 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 779712 779712 0 0.0
RAM 108320 108320 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 725708 725708 0 0.0
RAM 97220 97220 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 710176 710176 0 0.0
RAM 97436 97436 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552986 552986 0 0.0
RAM 204928 204928 0 0.0
lock CC3235SF_LAUNCHXL FLASH 585630 585630 0 0.0
RAM 205160 205160 0 0.0
efr32 lock-app BRD4187C FLASH 959768 959768 0 0.0
RAM 126184 126184 0 0.0
BRD4338a FLASH 755400 755400 0 0.0
RAM 255484 255484 0 0.0
window-app BRD4187C FLASH 1053652 1053644 -8 -0.0
RAM 122344 122344 0 0.0
esp32 all-clusters-app c3devkit DRAM 102968 102968 0 0.0
FLASH 1785786 1785786 0 0.0
IRAM 83862 83862 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 917360 917360 0 0.0
RAM 153332 153332 0 0.0
nxp contact mcxw71+release FLASH 690344 690344 0 0.0
RAM 61392 61392 0 0.0
lighting mcxw71+release FLASH 721904 721904 0 0.0
RAM 68036 68036 0 0.0
lock mcxw71+release FLASH 769000 769000 0 0.0
RAM 61764 61764 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1668860 1668860 0 0.0
RAM 213012 213012 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1587300 1587300 0 0.0
RAM 210276 210276 0 0.0
light cy8ckit_062s2_43012 FLASH 1454772 1454772 0 0.0
RAM 197000 197000 0 0.0
lock cy8ckit_062s2_43012 FLASH 1487084 1487084 0 0.0
RAM 224720 224720 0 0.0
qpg lighting-app qpg6200+debug FLASH 833808 833808 0 0.0
RAM 127548 127548 0 0.0
lock-app qpg6200+debug FLASH 770788 770788 0 0.0
RAM 118516 118516 0 0.0
realtek light-switch-app rtl8777g FLASH 704072 704072 0 0.0
RAM 106720 106720 0 0.0
lighting-app rtl8777g FLASH 755248 755248 0 0.0
RAM 127084 127084 0 0.0
stm32 light STM32WB5MM-DK FLASH 467692 467692 0 0.0
RAM 141160 141160 0 0.0
telink bridge-app tl7218x FLASH 709980 709980 0 0.0
RAM 91208 91208 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 797796 797796 0 0.0
RAM 41772 41772 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 789010 789010 0 0.0
RAM 94408 94408 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 715802 715802 0 0.0
RAM 52588 52588 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 749108 749108 0 0.0
RAM 71628 71628 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725948 725948 0 0.0
RAM 35336 35336 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603222 603222 0 0.0
RAM 109464 109464 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 821632 821636 4 0.0
RAM 92804 92804 0 0.0

if suffix > attribute_standard_range_max and suffix < global_range_min:
self.record_error(self.get_test_name(), location=location,
problem=f"Manufacturer attribute in undefined range {manufacturer_value} in cluster {cluster_id}",
problem=f"Manufacturer attribute in undefined range {
Copy link
Contributor

Choose a reason for hiding this comment

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

We're about to update the restyler so this doesn't happen - there was a bug in the restyler that is causing this weirdness. When that lands, would you mind reverting these changes? I think this might break python prior to 3.12.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merged in master after the PR for your restylizer change got merged and reverted the changes for the f-str lines in this file here now.

_, txt_str = self.dump_wildcard(None)
# Only dump the text format - it's more readable for debugging
self._log_structured_data('==== FAILURE_DUMP_txt: ', txt_str)
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if it's worthwhile logging these - it might just confuse people. Ditto with the exception.

Copy link
Contributor Author

@j-ororke j-ororke Oct 16, 2025

Choose a reason for hiding this comment

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

Ah ok, understood, I have removed the logging statements here and the logging statement in the exception below from the code here now.

LOGGER.info("dump_wildcard method not available - skipping device attribute dump")
else:
LOGGER.debug("No device attribute data available (endpoints_tlv not populated)")
except Exception as e:
Copy link
Contributor

Choose a reason for hiding this comment

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

what would cause an exception here? you should be catching both failure cases with the hasattr checks.

If you do need this, can you please change to be the specific exception rather than Exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right that the hasattr checks handle the missing attribute cases.
The exception handling is for the data access and serialization that happens inside dump_wildcard() itself, things such as:

  • Dictionary key access when traversing endpoints_tlv
  • JSON serialization of TLV data
  • String formatting with pformat()

I've changed it to catch only the specific exceptions that could realistically occur during those operations: AttributeError, KeyError, ValueError, and TypeError. This way we're not masking unexpected errors, just preventing data dump failures from interfering with the actual test failure reporting.

LOGGER.info("###########################################################")

# Attempt to dump device attribute data for debugging when problems are found
self._dump_device_attributes_on_failure()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please move this to above the problem dump? That will make the actual problems appear next to the failure message rather than forcing people to scroll up to above the device dump.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, moved the problem dump to above the problem logging.

@github-actions
Copy link

github-actions bot commented Oct 16, 2025

PR #41020: Size comparison from 43c9fb4 to 13fb594

Full report (22 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, psoc6, qpg, realtek, stm32)
platform target config section 43c9fb4 13fb594 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1106366 1106366 0 0.0
RAM 178802 178802 0 0.0
bl702 lighting-app bl702+eth FLASH 660956 660956 0 0.0
RAM 134881 134881 0 0.0
bl702+wifi FLASH 837068 837068 0 0.0
RAM 124349 124349 0 0.0
bl706+mfd+rpc+littlefs FLASH 1070036 1070036 0 0.0
RAM 117189 117189 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 898878 898878 0 0.0
RAM 105468 105468 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 983054 983054 0 0.0
RAM 109676 109676 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 770364 770364 0 0.0
RAM 103240 103240 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 782120 782120 0 0.0
RAM 108400 108400 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 727940 727940 0 0.0
RAM 97308 97308 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 712384 712384 0 0.0
RAM 97508 97508 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 554066 554066 0 0.0
RAM 205504 205504 0 0.0
lock CC3235SF_LAUNCHXL FLASH 587318 587318 0 0.0
RAM 205768 205768 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 933264 933264 0 0.0
RAM 161069 161069 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1676484 1676484 0 0.0
RAM 213660 213660 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1592556 1592556 0 0.0
RAM 210956 210956 0 0.0
light cy8ckit_062s2_43012 FLASH 1459172 1459172 0 0.0
RAM 197656 197656 0 0.0
lock cy8ckit_062s2_43012 FLASH 1491724 1491724 0 0.0
RAM 225376 225376 0 0.0
qpg lighting-app qpg6200+debug FLASH 836552 836552 0 0.0
RAM 127644 127644 0 0.0
lock-app qpg6200+debug FLASH 773252 773252 0 0.0
RAM 118620 118620 0 0.0
realtek light-switch-app rtl8777g FLASH 706224 706224 0 0.0
RAM 106800 106800 0 0.0
lighting-app rtl8777g FLASH 757320 757320 0 0.0
RAM 127164 127164 0 0.0
stm32 light STM32WB5MM-DK FLASH 469812 469812 0 0.0
RAM 141248 141248 0 0.0

- Fix f-strings in TC_DeviceBasicComposition.py for Python < 3.12
- Move device dump before problem logging for better failure visibility
- Remove noisy log messages from device dump on failure
- Use specific exceptions instead of catching all exceptions so that it isnt blanketed.
@github-actions
Copy link

github-actions bot commented Oct 16, 2025

PR #41020: Size comparison from 43c9fb4 to 530ac3a

Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 43c9fb4 530ac3a change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1106366 1106366 0 0.0
RAM 178802 178802 0 0.0
bl702 lighting-app bl702+eth FLASH 660956 660956 0 0.0
RAM 134881 134881 0 0.0
bl702+wifi FLASH 837068 837068 0 0.0
RAM 124349 124349 0 0.0
bl706+mfd+rpc+littlefs FLASH 1070036 1070036 0 0.0
RAM 117189 117189 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 898878 898878 0 0.0
RAM 105468 105468 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 983054 983054 0 0.0
RAM 109676 109676 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 770364 770364 0 0.0
RAM 103240 103240 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 782120 782120 0 0.0
RAM 108400 108400 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 727940 727940 0 0.0
RAM 97308 97308 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 712384 712384 0 0.0
RAM 97508 97508 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 554066 554066 0 0.0
RAM 205504 205504 0 0.0
lock CC3235SF_LAUNCHXL FLASH 587318 587318 0 0.0
RAM 205768 205768 0 0.0
efr32 lock-app BRD4187C FLASH 962192 962192 0 0.0
RAM 126268 126268 0 0.0
BRD4338a FLASH 757728 757720 -8 -0.0
RAM 255540 255540 0 0.0
window-app BRD4187C FLASH 1057460 1057452 -8 -0.0
RAM 122464 122464 0 0.0
esp32 all-clusters-app c3devkit DRAM 103192 103192 0 0.0
FLASH 1796424 1796424 0 0.0
IRAM 83862 83862 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 933264 933264 0 0.0
RAM 161069 161069 0 0.0
nxp contact mcxw71+release FLASH 691400 691400 0 0.0
RAM 61424 61424 0 0.0
lighting mcxw71+release FLASH 722896 722896 0 0.0
RAM 68084 68084 0 0.0
lock mcxw71+release FLASH 773168 773168 0 0.0
RAM 61868 61868 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1676484 1676484 0 0.0
RAM 213660 213660 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1592556 1592556 0 0.0
RAM 210956 210956 0 0.0
light cy8ckit_062s2_43012 FLASH 1459172 1459172 0 0.0
RAM 197656 197656 0 0.0
lock cy8ckit_062s2_43012 FLASH 1491724 1491724 0 0.0
RAM 225376 225376 0 0.0
qpg lighting-app qpg6200+debug FLASH 836552 836552 0 0.0
RAM 127644 127644 0 0.0
lock-app qpg6200+debug FLASH 773252 773252 0 0.0
RAM 118620 118620 0 0.0
realtek light-switch-app rtl8777g FLASH 706224 706224 0 0.0
RAM 106800 106800 0 0.0
lighting-app rtl8777g FLASH 757320 757320 0 0.0
RAM 127164 127164 0 0.0
stm32 light STM32WB5MM-DK FLASH 469812 469812 0 0.0
RAM 141248 141248 0 0.0
telink bridge-app tl7218x FLASH 710462 710462 0 0.0
RAM 90436 90436 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 796848 796848 0 0.0
RAM 40936 40936 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 788048 788048 0 0.0
RAM 93580 93580 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 714974 714974 0 0.0
RAM 51736 51736 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 748278 748278 0 0.0
RAM 70784 70784 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725126 725126 0 0.0
RAM 34484 34484 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 602366 602366 0 0.0
RAM 108628 108628 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 820668 820672 4 0.0
RAM 91976 91976 0 0.0

# Don't let data access or serialization errors interfere with the original test failure
pass

def _log_structured_data(self, start_tag: str, dump_string: str):
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a duplicate of the function in basic_composition.py

Copy link
Contributor Author

@j-ororke j-ororke Nov 6, 2025

Choose a reason for hiding this comment

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

Thanks for catching that!
I’ve removed this function from the basic_composition support module. There’s a test, test_TC_IDM_12_1 in the TC_DeviceBasicComposition module, that uses this function directly; it originally came from there (previously embedded inside that test).
I’ve now updated that test to inherit the function from here, and renamed this function so that it doesn't appear to be a private function anymore.

j-ororke and others added 4 commits November 6, 2025 10:11
… module, now inheriting it directly from matter_testing in test_TC_IDM_12_1 test
… module, now inheriting it directly from matter_testing in test_TC_IDM_12_1 test in TC_DeviceBasicCompositon test module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants