SmartThingsEdgeDrivers icon indicating copy to clipboard operation
SmartThingsEdgeDrivers copied to clipboard

Make matter switch tests backwards compatible down to lua libs v10

Open nickolas-deboom opened this issue 8 months ago • 3 comments

Type of Change

  • [ ] WWST Certification Request
    • If this is your first time contributing code:
      • [ ] I have reviewed the README.md file
      • [ ] I have reviewed the CODE_OF_CONDUCT.md file
      • [ ] I have signed the CLA
    • [ ] I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • [ ] Bug fix
  • [ ] New feature
  • [ ] Refactor
  • [x] Test case update

Checklist

  • [ ] I have performed a self-review of my code
  • [ ] I have commented my code in hard-to-understand areas
  • [ ] I have verified my changes by testing with a device or have communicated a plan for testing
  • [ ] I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Add backwards compatibility for matter switch test cases down to lua libs version v10. Most of the issues were from test cases expecting native handler registrations, which was added in v11. This PR also fixes a bug in the driver code for lua libs version v10 and lower, which prevented the energyMeter capability from being emitted.

It might be possible to extend support to even lower versions, but there are a few additional api changes that would need to be accounted for.

Also note that to run these tests against lower versions, any capabilities that are not available in that version of the lua libs would need to be manually added to prevent test failures.

Summary of Completed Tests

nickolas-deboom avatar Mar 27 '25 19:03 nickolas-deboom

Channel deleted.

github-actions[bot] avatar Mar 27 '25 19:03 github-actions[bot]

Test Results

   66 files    424 suites   0s ⏱️ 2 195 tests 2 195 ✅ 0 💤 0 ❌ 3 721 runs  3 721 ✅ 0 💤 0 ❌

Results for commit 32a9f658.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Mar 27 '25 19:03 github-actions[bot]

File Coverage
All files 98% :white_check_mark:
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/aqara-cube/init.lua 96% :white_check_mark:
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/embedded-cluster-utils.lua 91% :white_check_mark:
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/eve-energy/init.lua 91% :white_check_mark:

Minimum allowed coverage is 90%

Generated by :monkey: cobertura-action against 32a9f658ebe00aef457e6b1ef0bf21393a0f492b

github-actions[bot] avatar Mar 27 '25 19:03 github-actions[bot]

do you think this is worth a rebase? Should we close this? Just checking since it's been open for ~6 months.

hcarter-775 avatar Oct 07 '25 15:10 hcarter-775

do you think this is worth a rebase? Should we close this? Just checking since it's been open for ~6 months.

I would say probably not because backwards compatibility was broken by scripting engine changes. Closing

nickolas-deboom avatar Oct 08 '25 16:10 nickolas-deboom