Azure / iotedgehubdev

IoT Edge Hub Dev Tool
Other
88 stars 31 forks source link

[Question] Listen to a single module output while under debug/test? #279

Closed fbrandao closed 4 years ago

fbrandao commented 4 years ago

Hi,

Currently we have a solution which includes multiple modules that send messages to each other, and if we want to debug any module in isolation we can using the single module approach, but this as far as i know only gives you the option of specifying the inputs that you can then use to send messages to the module.

How about the output messages of that module? Is there any way of "listening" to outgoing messages via any kind of interface?

The main objective here is to inject data into a module, and verify that the outputs it produces are correct, being them REST, MQTT or whatever.

Hope you can help!

Thank you

SLdragon commented 4 years ago

Hi, fbrandao, I think you can use console logs to "listening" outgoing message, current there is no interface to monitor the output. For single module debug, we add an utility container which would send messages to the specific input, and we cannot mornitor the outgoing messages from modules, so I think the best way to monitor is to add some console logs for that.

fbrandao commented 4 years ago

Hi @SLdragon ,

Thanks a lot for the reply. Yes we already use that approach for debugging, ie we have logs in console to see what messages are being received.

Are you aware of any tool/implementation that would resemble black box testing for individual azure iot edge modules?

We want to verify that every module is doing its job correctly in isolation, yes we have unit tests, but we want to try them with real data and very that the messages they send upstream is correct.

Hope you can help.

SLdragon commented 4 years ago

Hi, @fbrandao, as far as I know, there is no black box testing for the modules. You can add some end to end test for your project.

For example, in our iotedgehubdev project, we have E2E test, which would try to invoke command from iotedgehubdev and start the Edge modules and send messages, then it will check whether the output is correct to ensure that each command works fine.

related code can be found here: https://github.com/Azure/iotedgehubdev/blob/master/tests/test_cli.py#L223

E2E test may introduce some instability for the CI, so sometimes it would failed due to network issue, and we need to trigger the CI again.

SLdragon commented 4 years ago

Hi, fbrandao, I am going to close this issue due to it is a question, feel free to create another issue if you still have problems, thank you!