Repository navigation
zwave test: properly seed credentials test file data - #3308
Conversation
|
Channel deleted. |
|
zwave-lock_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against 02b07c5 |
Test Results 73 files 545 suites 0s ⏱️ Results for commit 02b07c5. ♻️ This comment has been updated with latest results. |
cbaumler
left a comment
There was a problem hiding this comment.
Left a few minor comments. Otherwise, LGTM.
nit: Unrelated to this diff: the find_all_entries_by shim at the top is dead since tables.lua defines it. Fine to drop here or in a follow-up.
nit: It looks like deleteAllCredentials: returns busy when another operation is already in progress calls seed_credentials but the test outcome doesn't depend on having seeded credentials. You could just remove the call from the test so that the timers aren't scheduled or you could advance the clock and expect the UserCode:set and cleanup events.
| local event = capabilities.lockUsers.users(so_far, { visibility = { displayed = false } }) | ||
| mock_latest_state[mock_state_key("main", event.capability.ID, event.attribute.NAME)] = event.value.value | ||
| for j = 1, i do table.insert(so_far, entries[j]) end | ||
| test.socket.capability:__expect_send( |
There was a problem hiding this comment.
nit: Since the expected event is queued before add_entry, a failed seed will show up as an unrelated missing-message error later. Consider asserting the return value first and queuing the expectation only on success. Otherwise the assert message is the clearer failure.
There was a problem hiding this comment.
This issue here is that add_entry works synchronously, so unless the expectation is set prior to the event occurring, it will get marked as a failure
15eb4f0 to
02b07c5
Compare
Description of Change
Seeding data did not work in one of the Zwave Lock test files. Because of this, one of the tests was only succeeding vacuously. Per Claude:
Summary of Completed Tests
Test file changes.