UncleRus / esp-idf-lib

Component library for ESP32-xx and ESP8266

Home Page:https://esp-idf-lib.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integration Proposal for Software Testing using Wokwi Simulator CI in esp-idf-lib

hayschan opened this issue · comments

The issue

Hello esp-idf-lib Maintainers and Community,

As an active user and contributor to the esp-idf-lib project, I've recognized the project's significant impact on facilitating the development of embedded and IoT applications. The library's comprehensive support for a myriad of components, sensors, and ICs is commendable. However, the current Continuous Integration (CI) system primarily focuses on compiling the code without executing any form of automated tests to validate the functionality of these components under various conditions.

The context

I propose the integration of Wokwi CI into our CI pipeline to bridge this gap. Wokwi, an advanced simulator for Arduino and ESP projects, supports a wide range of components and sensors, making it a perfect fit for our testing needs. More so, Wokwi's ability to simulate custom components—demonstrated through my development of a driver for an unsupported I2C sensor model (Custom Component Example)—provides us with the flexibility to test even the most niche parts of our library.

The integration process involves leveraging Wokwi CI's GitHub Actions to execute automated tests for each pull request or push to the repository. This would not only streamline our testing process but also enhance our library's reliability and usability for developers worldwide.

Possible solution

The technical benefits of integrating Wokwi CI include:

  1. Automated Testing: Enabling automated, simulated runs of our components' interaction with various sensors and ICs, ensuring that each component behaves as expected across different scenarios without the need for physical hardware. For the ESP32 MCU, WokWi supports ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6, ESP32-H2, which should be enough for our use case.
  2. Native components: If the sensor or IC is natively supported, that would be the least amount of workload. Wokwi supports a wide range of components and sensors.
  3. Custom Component Simulation: Even not supported, Utilizing Wokwi's custom components feature allows us to extend our testing capabilities to include every sensor and IC supported by esp-idf-lib, regardless of Wokwi's native support. I've already developed a driver for an I2C sensor not officially supported by Wokwi and utilized the custom components feature for testing (see my driver here).
  4. Enhanced Reliability: By simulating real-world applications, we can identify and rectify potential issues early in the development cycle, significantly reducing the likelihood of bugs reaching production.

I am keen to collaborate with the maintainer team to define the integration specifics and contribute to the implementation of this proposal. Your feedback and suggestions on this proposal would be highly appreciated.

Thank you for considering this enhancement to our project's development process.

Confirmation

  • This report is not a bug report in code, a question, nor a request for drivers.