velxio/test/test_custom_chips_boards
David Montero Crespo 7f2014bef7 Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions
- Implemented `esp32_spi_chip_demo.ino` to demonstrate SPI communication with a 74HC595 shift register.
- Created `esp32_uart_chip_demo.ino` for UART loopback testing with ROT13 transformation.
- Added Python tests for compiling chips and sketches, ensuring valid WASM output and successful compilation for various board families.
- Developed end-to-end tests for ESP32 with custom chips using I2C and SPI, validating synchronous communication through the backend.
- Introduced GPIO bridge tests to verify serial communication and GPIO state changes.
- Ensured all tests validate the expected behavior of the custom chips and their interaction with the ESP32 firmware.
2026-04-28 19:24:39 -03:00
..
sketches Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
README.md Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
__init__.py Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
conftest.py Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
test_compile_endpoint.py Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
test_esp32_chip_i2c.py Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
test_esp32_chip_spi.py Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
test_esp32_chip_uart.py Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
test_esp32_gpio_bridge.py Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
test_multi_board_sketch_compile.py Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00

README.md

test_custom_chips_boards

Multi-board validation suite for the Velxio Custom Chip system. These tests hit a running backend (the same uvicorn the frontend talks to) and assert that the integration works end-to-end on every supported board family.

Pre-requisites

  • Backend running and reachable. By default the suite expects it at http://127.0.0.1:8765. Override with:
    export VELXIO_BACKEND_URL=http://localhost:8001
    
  • WASI-SDK installed on the backend host (the /api/compile-chip/status endpoint reports this).
  • Python deps: pip install httpx websockets pytest pytest-asyncio.

Running

From the repo root:

# All tests
pytest test/test_custom_chips_boards/ -v

# Just the compile-endpoint smoke (no QEMU needed):
pytest test/test_custom_chips_boards/test_compile_endpoint.py -v

# Just the ESP32 WS bridge E2E (requires QEMU running in backend):
pytest test/test_custom_chips_boards/test_esp32_gpio_bridge.py -v

Files

Test What it validates
test_compile_endpoint.py All 11 example chips compile via /api/compile-chip and produce valid WASM
test_esp32_gpio_bridge.py An ESP32 sketch can exchange GPIO events with the WebSocket — the same path a custom chip would use

Why "validation" not "integration"

Custom chips run inside the browser for AVR, RP2040 and ESP32-C3. There's no Python runtime that can host them. So this suite tests the parts that do live on the backend (compile endpoint, ESP32 QEMU GPIO bridge), and the browser-side AVR coverage stays in the JS sandbox at test/test_custom_chips/.

The full multi-board support matrix is documented in ../autosearch/07_multi_board_support.md.