Skip to content

tests: Add minimum firmware version requirement for hardware scenarios. #243

@nedseb

Description

@nedseb

Description

Some hardware test scenarios require specific DAPLink firmware features (e.g. config zone commands added in firmware v1.1.0). Running these tests on a board with an older firmware causes crashes or false failures.

We need a mechanism to declare a minimum firmware version per scenario and skip tests gracefully when the firmware is too old.

Note: this issue originally referenced flash.firmware_version(). Since then, the bridge layer has been factored out and the version query belongs to DaplinkBridge (see #242). The runner should query the bridge directly.

Proposed approach

YAML scenario declaration

Add an optional min_firmware field to scenarios:

driver: steami_config
min_firmware: [1, 1, 0]   # Requires config zone support

tests:
  - name: "Save and load config on hardware"
    mode: [hardware]
    ...

Or at the individual test level:

  - name: "Save and load magnetometer calibration on hardware"
    min_firmware: [1, 1, 0]
    mode: [hardware]
    ...

Test runner behavior

  1. Before running a hardware test with min_firmware, query bridge.firmware_version() (where bridge is a DaplinkBridge instance built from the test I2C bus).
  2. If the firmware version is below the minimum, skip the test with a clear message:
    SKIPPED: requires DAPLink firmware >= 1.1.0 (found 1.0.0)
  3. Cache the version query for the duration of the test session to avoid repeated I2C reads.

Fallback

If firmware_version() raises an error (old firmware without the command), treat the version as (0, 0, 0) and skip all tests with a minimum requirement.

Dependencies

Related

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions