Helper functions for IoT test execution #201
Conversation
ea47762 to
dc5673e
Compare
memnochproxy
left a comment
There was a problem hiding this comment.
These functions all need better documentation about what parameters are expected. If someone passes in a dictionary or an object, please document what the expected keys are and what the behavior is when the keys are missing.
Please do not nest functions: move copy_into_report() function out of the parent function and document it and the return value indicating success. Also, please put some some basic check on what the absolute path is. Collections of reports can grow to many millions of directories, and also the value of '.' (current directory) could also evaluate to '/' or 'c:' which should not be a legitimate input. Please consider a reasonable limit to the number of directories that method should scan and throw an exception when the method reaches that limit.
Also
thanks for the suggestions. I’ll improve the IoT helper by documenting expected parameters, required keys, and fallback behavior for missing values. I’ll also move copy_into_report() into a standalone helper with a documented return value, and add safety checks to reject unsafe paths (/, ., c:) along with a bounded directory traversal limit that raises an exception when exceeded. |
0a90dbf to
d2d73e2
Compare
…ting Signed-off-by: sivakondri-CT <kondru.sankar@candelatech.com>
d2d73e2 to
1d3c708
Compare
Hi @a-gavin , @memnochproxy I’ve updated the PR addressing the mentioned suggestions. Please review when you have some time. Thanks! |
smileyrekiere
left a comment
There was a problem hiding this comment.
The changes requested by Jed appear to have been met.
This file contains helper functions related to IoT tests, which can be imported and reused wherever IoT test execution or reporting is required.