From 6ce6cc37c8349c21dd8c897951132d9a02f2ad87 Mon Sep 17 00:00:00 2001 From: kiera-robinson Date: Wed, 11 Dec 2024 13:51:47 -0500 Subject: [PATCH] CHAD-14284: Test zigbee health monitoring opt out with zigbee-motion and zigbee-contact drivers; commented out any tests that involved health checking --- .../src/test/test_zigbee_contact.lua | 55 ++++++++++--------- .../test_all_capabilities_zigbee_motion.lua | 43 ++++++++------- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact.lua b/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact.lua index 9930dcfb0f..a90665d41b 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact.lua @@ -161,34 +161,35 @@ test.register_message_test( } ) -test.register_coroutine_test( - "Health check should check all relevant attributes", - function() - test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) - test.socket.zigbee:__expect_send({ - mock_device.id, - TemperatureMeasurement.attributes.MaxMeasuredValue:read(mock_device) - }) - test.socket.zigbee:__expect_send({ - mock_device.id, - TemperatureMeasurement.attributes.MinMeasuredValue:read(mock_device) - }) - test.wait_for_events() +-- removal due to change to stop health checks going forward +-- test.register_coroutine_test( +-- "Health check should check all relevant attributes", +-- function() +-- test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) +-- test.socket.zigbee:__expect_send({ +-- mock_device.id, +-- TemperatureMeasurement.attributes.MaxMeasuredValue:read(mock_device) +-- }) +-- test.socket.zigbee:__expect_send({ +-- mock_device.id, +-- TemperatureMeasurement.attributes.MinMeasuredValue:read(mock_device) +-- }) +-- test.wait_for_events() - test.mock_time.advance_time(50000) - test.socket.zigbee:__set_channel_ordering("relaxed") - test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) - test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) - test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:read(mock_device) }) - test.wait_for_events() - end, - { - test_init = function() - test.mock_device.add_test_device(mock_device) - test.timer.__create_and_queue_test_time_advance_timer(30, "interval", "health_check") - end - } -) +-- test.mock_time.advance_time(50000) +-- test.socket.zigbee:__set_channel_ordering("relaxed") +-- test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) +-- test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) +-- test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:read(mock_device) }) +-- test.wait_for_events() +-- end, +-- { +-- test_init = function() +-- test.mock_device.add_test_device(mock_device) +-- test.timer.__create_and_queue_test_time_advance_timer(30, "interval", "health_check") +-- end +-- } +-- ) test.register_coroutine_test( "Refresh necessary attributes", diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_all_capabilities_zigbee_motion.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_all_capabilities_zigbee_motion.lua index 235add1b65..381f2062d5 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_all_capabilities_zigbee_motion.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_all_capabilities_zigbee_motion.lua @@ -172,28 +172,29 @@ test.register_message_test( } ) -test.register_coroutine_test( - "Health check should check all relevant attributes", - function() - test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added"}) - test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MinMeasuredValue:read(mock_device) }) - test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MaxMeasuredValue:read(mock_device) }) - test.wait_for_events() +-- removal due to change to stop health checks going forward +-- test.register_coroutine_test( +-- "Health check should check all relevant attributes", +-- function() +-- test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added"}) +-- test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MinMeasuredValue:read(mock_device) }) +-- test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MaxMeasuredValue:read(mock_device) }) +-- test.wait_for_events() - test.mock_time.advance_time(50000) -- 21600 is the battery max interval - test.socket.zigbee:__set_channel_ordering("relaxed") - test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) - test.socket.zigbee:__expect_send({ mock_device.id, RelativeHumidity.attributes.MeasuredValue:read(mock_device) }) - test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) - test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:read(mock_device) }) - end, - { - test_init = function() - test.mock_device.add_test_device(mock_device) - test.timer.__create_and_queue_test_time_advance_timer(30, "interval", "health_check") - end - } -) +-- test.mock_time.advance_time(50000) -- 21600 is the battery max interval +-- test.socket.zigbee:__set_channel_ordering("relaxed") +-- test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) +-- test.socket.zigbee:__expect_send({ mock_device.id, RelativeHumidity.attributes.MeasuredValue:read(mock_device) }) +-- test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) +-- test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:read(mock_device) }) +-- end, +-- { +-- test_init = function() +-- test.mock_device.add_test_device(mock_device) +-- test.timer.__create_and_queue_test_time_advance_timer(30, "interval", "health_check") +-- end +-- } +-- ) test.register_coroutine_test( "Configure should configure all necessary attributes",