Skip to content

Document E2E test fixture register layouts #370

Description

@groupsky

Description

Create documentation explaining the register layout of each E2E test fixture to improve test maintainability.

Context

The E2E tests use emulator fixtures (port1-single-device.json, port2-multi-device.json) but the exact register addresses and values in each fixture are not clearly documented. This makes it difficult for test maintainers to understand:

  • Which register addresses exist in each fixture
  • What values are stored at each address
  • Which register types are available (holding, input, coil, discrete)
  • Expected hex representations of values

Current Issues

From PR #366 review:

  • Test comment originally said "has holding registers 0-43" but fixture has sparse layout (0-10, 42-43)
  • Input register availability was unclear ("may not exist" → verified: doesn't exist)
  • Hex value 08FC lacked context (register 0 = voltage = 2300 decimal)

Proposed Documentation

Create tests/e2e/fixtures/README.md with:

For Each Fixture:

  • Description - What device(s) it emulates
  • Port assignment - Which virtual ports it uses
  • Slave IDs - Which slave IDs respond
  • Register layout - Table showing:
    • Address
    • Register type (holding/input/coil/discrete)
    • Value (decimal and hex)
    • Field name (voltage, current, etc.)

Example Format:

## port1-single-device.json

**Device:** EX9EM energy meter  
**Port:** /tmp/ttyV0 (tests use /tmp/ttyV1)  
**Slave ID:** 1  

### Holding Registers:
| Address | Value (Dec) | Value (Hex) | Field Name |
|---------|-------------|-------------|------------|
| 0       | 2300        | 08FC        | Voltage    |
| 1       | 520         | 0208        | Current    |
| ...     | ...         | ...         | ...        |
| 42      | 4           | 0004        | Config     |
| 43      | 1           | 0001        | Config     |

**Note:** Registers 11-41 do not exist (sparse layout).

### Input Registers:
None

### Coils:
None

### Discrete Inputs:
None

Acceptance Criteria

  • README.md created in tests/e2e/fixtures/
  • All emulator fixtures documented
  • Register addresses, values, and types listed
  • Sparse layouts clearly noted
  • Hex values included for verification

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    developer-experienceImproves developer experiencedocumentationImprovements or additions to documentationpriority:mediumMedium priorityscope:documentationIssues related to documentationscope:testingIssues related to testing infrastructuretype:docsDocumentation improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions