-
Notifications
You must be signed in to change notification settings - Fork 0
Add parameter validation E2E tests for device-profiler #369
Copy link
Copy link
Open
Labels
priority:lowLow priority taskLow priority taskscope:device-profilerIssues related to the device-profiler packageIssues related to the device-profiler packagescope:testingIssues related to testing infrastructureIssues related to testing infrastructuretestingTesting improvements and additionsTesting improvements and additionstype:testingTesting improvements or additionsTesting improvements or additionsvalidationInput validation and configuration checksInput validation and configuration checks
Description
Description
Add E2E test coverage for device-profiler parameter boundary conditions and validation.
Context
PR #366 adds device-profiler E2E tests covering happy paths and basic error cases. However, parameter validation at boundaries is not comprehensively tested in E2E (though unit tests provide coverage).
Test Scenarios
Address Range Validation
- Test
--start > --end(invalid range)
ya-modbus-profile --port /tmp/ttyV1 --slave-id 1 --start 100 --end 50- Expected: Command-line error or validation error
Batch Size Validation
- Test
--batch 0(invalid) - Test
--batch -1(negative) - Test very large batch size (e.g., 200)
Slave ID Validation
- Test
--slave-id 0(below minimum of 1) - Test
--slave-id 248(above maximum of 247) - Already tested: slave ID 999 (out of range)
Large Address Ranges
- Test scanning large range (e.g., 0-1000)
- Verify performance and memory usage are reasonable
- Ensure scan completes without hanging
Maximum Register Address
- Test scanning at maximum Modbus address (65535)
- Verify address boundary handling
Implementation
Add tests to tests/e2e/tests/05-device-profiler.bats:
- Group under "Parameter Validation Tests" section
- Use
assert_failurefor invalid parameters - Use
assert_output_containsto verify error messages
Acceptance Criteria
- Invalid address range test passes
- Batch size validation tests pass
- Slave ID boundary tests pass
- Large range scan test passes
- Error messages are clear and helpful
Related
- PR test(e2e): add device-profiler register scanning tests #366 (device-profiler E2E tests)
- Unit tests:
packages/device-profiler/src/program.test.ts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority:lowLow priority taskLow priority taskscope:device-profilerIssues related to the device-profiler packageIssues related to the device-profiler packagescope:testingIssues related to testing infrastructureIssues related to testing infrastructuretestingTesting improvements and additionsTesting improvements and additionstype:testingTesting improvements or additionsTesting improvements or additionsvalidationInput validation and configuration checksInput validation and configuration checks