test(e2e): add device-profiler register scanning tests#366
Open
test(e2e): add device-profiler register scanning tests#366
Conversation
@ya-modbus/cli
@ya-modbus/device-profiler
@ya-modbus/driver-ex9em
@ya-modbus/driver-loader
@ya-modbus/driver-or-we-516
@ya-modbus/driver-sdk
@ya-modbus/driver-types
@ya-modbus/driver-xymd1
@ya-modbus/emulator
@ya-modbus/mqtt-bridge
@ya-modbus/transport
commit: |
Add comprehensive E2E tests for the ya-modbus-profile command which scans Modbus register ranges to discover readable/writable registers. Tests cover: - Basic register scanning (holding and input registers) - Batch size variations (small and large batches) - Error handling (non-existent registers, invalid parameters) - Serial port configuration (baud rate, parity) - Output format verification (progress, summary table) - Multiple device support (scanning different slave IDs) - Resource cleanup verification Includes 19 new tests bringing total E2E coverage to 102 tests. NOTE: This tests packages/device-profiler (ya-modbus-profile command), NOT packages/cli (ya-modbus discover command). The profiler scans register address ranges to map device capabilities, while discover finds devices on the bus. Addresses #239
5339c43 to
072d457
Compare
- Fix line 44: specify sparse register addresses (0-10, 42-43) not range - Fix line 221: explicitly state fixture has no input registers - Fix line 87: clarify hex value is from register 0 (voltage field) These changes improve test maintainability by accurately documenting fixture contents rather than using vague language.
This was referenced Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds comprehensive E2E test coverage for the device-profiler package (
ya-modbus-profilecommand), which scans Modbus register ranges to discover readable/writable registers.packages/device-profiler(register scanning), NOTpackages/cli(device discovery).Test Coverage:
Implementation Details:
tests/e2e/tests/05-device-profiler.batswith 19 new tests04-cli.batshelpers.bashya-modbus-profileCLI command (notya-modbus discover)What device-profiler does:
The device-profiler scans register address ranges to map which registers respond:
This is different from the CLI's
discovercommand which finds devices on the bus.Documentation Improvements:
Verification:
All 102 E2E tests pass (83 existing + 19 new):
Follow-Up Work
Coverage gaps identified and tracked in separate issues:
Test Plan
./run-tests.sh 05-device-profilerAddresses #239