Commit e5f08b6
Add Hotline codec fixtures and tests for wireframe_testing (#487)
* feat(wireframe_testing): add codec fixtures for Hotline protocol testing
Introduce a new module providing fixture functions that generate valid,
invalid, truncated, and correlated Hotline-framed wire bytes for use in tests.
These fixtures allow test authors to easily produce raw wire data for codec
exercise, including error conditions that are hard to manually craft.
Includes:
- Valid frames with specified payloads and transaction IDs
- Oversized payload frames that trigger decoder errors
- Mismatched total_size frames to test error handling
- Truncated headers and payloads producing decode errors
- Multi-frame sequences sharing or incrementing transaction IDs
Supports comprehensive unit and BDD integration tests verifying correct
codec behaviours when decoding these fixtures.
Also adds documentation updates and marks roadmap item 9.7.2 as done.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* refactor(codec-fixtures): introduce typed wrappers and helper functions
- Added `TransactionId`, `MaxFrameLength`, and `PayloadLength` newtypes for hotline frame parameters for improved type safety and clarity.
- Updated fixture functions to accept these newtypes instead of raw primitives.
- Refactored decode test helpers to use assertion helper functions simplifying test code and error validation.
- Cleaned up decoding tests by consolidating repeated error string checks into reusable assertions.
- Updated exports to include new helper types.
- Improved documentation and consistency in wireframe testing helpers.
These changes consolidate frame codec fixture logic, improve readability, and ease future maintenance and extension of tests and helpers.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* test(codec_fixtures): refactor frame transaction ID checks into helper function
Introduced `assert_transaction_ids` helper to verify transaction IDs in frames. Replaced repetitive individual frame ID assertions with this helper in existing tests for improved code clarity and reuse.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* refactor(tests,codec-fixtures): consolidate codec fixture decoding logic
Refactored the codec fixture decoding methods in tests/fixtures/codec_fixtures.rs to delegate to a single helper method decode_fixture, reducing code duplication and improving clarity. Also fixed frame count assertion in tests/codec_fixtures.rs by using assert_frame_count helper. Minor fixes include using wrapping_add for transaction ID calculation in wireframe_testing helpers and a typo correction in docs.
This change improves maintainability without altering functionality.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* refactor(codec-fixtures, wireframe-testing): generalize fixture helpers and improve test state reset
- Changed multiple fixture helper function parameters to accept `impl Into<T>` for flexibility.
- Updated decoding fixture method to clear previous frames and errors before decoding.
- Adjusted documentation and comments for clarity, including error messages wording in scenarios.
- Ensured truncated payload fixture always claims at least 1 byte to guarantee truncation.
These improvements enhance API ergonomics and test reliability.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* docs(codec_fixtures): update codec_fixtures docs for API and error handling
Revise documentation in codec_fixtures to reflect changes in error handling,
parameter types (using Into traits), and fixture API descriptions. Clarify
behavior on truncated frame decoding and error reporting via decode_eof.
Improve explanations of fixture functions and update terminology for error
paths to enhance clarity and accuracy in the docs.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
---------
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>1 parent 859f2b9 commit e5f08b6
File tree
15 files changed
+1441
-1
lines changed- docs
- execplans
- tests
- features
- fixtures
- scenarios
- steps
- wireframe_testing/src
- helpers
15 files changed
+1441
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
370 | 393 | | |
371 | 394 | | |
372 | 395 | | |
| |||
Lines changed: 582 additions & 0 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
264 | 308 | | |
265 | 309 | | |
266 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments