Skip to content

v0.3.0 — receiver plugin API + rename

Choose a tag to compare

@m-mcgowan m-mcgowan released this 05 May 04:50
· 22 commits to main since this release

Added

  • Receiver plugin API: packages can declare a receiver class under the embedded_test_runner.receivers entry-point group and have it auto-attached to the runner's router. See README "Receiver plugins" for the contract. Enables pio-gcov and similar packages to attach per-partition capture receivers without per-project Python.
  • Partition lifecycle hooks: on_partition_start() / on_partition_complete() on EmbeddedTestRunner. Default implementations forward to plugin receivers that opt in. Subclasses overriding either hook should call super() to preserve plugin notification.
  • Test environment variables via ETST:ARGS / --env K=V: host forwards ETST_ENV_* host env vars and pio test -a --env K=V arguments to the firmware before each RUN. New etst::env(key) / etst::env_int(key, default) lookups in <etst/env.h>, plus a require_env("KEY") doctest decorator that skips a test when the named env var is missing.

Changed

  • Renamed: pio-test-runner → embedded-test-runner, pio_test_runner → etst, ptr_doctest → etst::doctest. Include path: <etst/...>. Clean break — no backward-compat aliases.
  • Config struct replaces weak hooks: ptr_board_init, ptr_after_cycle, ptr_configure_context removed. Use etst::config and etst::doctest::config.
  • Listener renamed: PtrTestListener → EtstDoctestListener.
  • doctest_runner.h moved: <pio_test_runner/doctest_runner.h> → <etst/doctest/runner.h>.

Fixed

  • open_serial retry default restored: _open_serial no longer passes retries=1, which had overridden the 5-retry default and turned transient sub-second port unavailability after USB-CDC re-enumeration into a hard partition failure on back-to-back pio test runs.
  • PIO doctest parser integration: forward blank lines to PIO's DoctestTestCaseParser so it can commit accumulated TEST CASE: header tokens; collapse parser-emitted subcase entries to TEST_CASE granularity in _ensure_test_results. Together these eliminate phantom empty-name cases and subcase-iteration double-counting in PIO's outer summary.
  • Example shim libdeps glob: examples/test_custom_runner.py and tests/integration/test/test_custom_runner.py now glob */embedded-test-runner/src (matched the post-rename library.json name).

Migration

The PTR→ETST rename is a clean break with no backward-compat aliases. Consumers must update:

  • C++ includes: <pio_test_runner/...> → <etst/...>
  • C++ namespaces: ptr_doctest:: → etst::doctest::
  • C++ weak hooks: ptr_board_init / ptr_after_cycle / ptr_configure_context → assign to etst::config / etst::doctest::config struct fields
  • Python imports: from pio_test_runner.runner import … → from etst.runner import …
  • Protocol prefix in any host-side parsers: PTR: → ETST: (already breaking in 0.2.0 — re-noting for completeness)
  • Environment variables: PTR_* → ETST_* (old names still accepted with deprecation warning)
  • library.json name in libdeps globs: pio-test-runner → embedded-test-runner (this affects copies of the example shim that pre-date 0.3.0 — re-copy examples/test_custom_runner.py)