test(hardware): add comprehensive bus type inference testing #244
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
This PR adds comprehensive testing for hardware bus type inference functions to address issue #161. The implementation follows a four-phase approach covering all device patterns, drivers, and real-world cloud provider scenarios.
What Changed
New Test File
internal/hardware/graph/bus_inference_test.go(715 lines)Test Coverage by Phase
Phase 1: Core Disk Bus Type Pattern Tests
Phase 2: Network Driver Detection Tests
Phase 3: Bus Connection Relationship Tests
Phase 4: Real-World Device Pattern Validation
Test Statistics
Test Results
Coverage Improvement:
All tests passing:
Key Findings
The tests document current implementation behavior:
Success Criteria Met
✅ Achieve comprehensive coverage for bus inference functions
✅ Test all documented device naming patterns
✅ Cover all supported bus types
✅ Validate unknown device fallback behavior
✅ Test relationship creation for all bus types
Testing
Closes #161