A bit of an open question but I’m wondering if anyone has discovered a good framework for automated testing on the target hardware. My test target is a custom ESP32 that needs to be subjected to Bluetooth interaction, knock/ vibration & SD card (sound recording & logging) use. I’m considering putting together a custom application (Python) on a RPi Zero or similar. This can issue the Bluetooth packets & log/parse the serial output of the ESP32. On crashes it should be able to send email/ alerts etc…
Anyone aware of something like this or a better solution?
I can only recommend using “Robot Framework” in this regard. You basically can write the tests in Python or the Robot language, the execution of which is orchestrated in a
.robot file, and the Robot Framework takes care of the test execution and report generation. It’s much superior than writing just custom Python scripts to test everything. (Or think of it that way: If you need to write custom python code anyways for your test cases, you might as well do it with the Robot Framework and get report generation for free.)
Many thanks! Looks promising, I’ll give it a try.
And also you can prefectly combine Robot Framework with PlatformIO. After all, PlatformIO can already do unit testing, the lower part of the testing pyramid, with Unity, Google Test etc., even with remotely connected hardware (pio remote). For example, building the firmware-to-tested in PlatformIO, uploading it to the board, running it through the unit tests in PlatformIO and then passing it on to higher-level testing (integration testing, end to end testing) in Robot Framework.
Plus the whole thing can be nicely integrated into the CI pipeline for Github Actions, or Gitlab CI/CD, etc., so that this happens in an automated way on every commit of the firmware project. The result of these tests is then also parsed back and displayed, graphs over time can be created, et cetera. The sky is the limit here.
The latest blog post on Pio Labs is also useful for that: