test(hardware): add comprehensive unit tests for NUMA distance relationships#245
Closed
jra3 wants to merge 3 commits into
Closed
test(hardware): add comprehensive unit tests for NUMA distance relationships#245jra3 wants to merge 3 commits into
jra3 wants to merge 3 commits into
Conversation
Add linux-tools-generic package to GitHub Actions build dependencies to provide bpftool utility required by generate-vmlinux target. The ARM64 build job was failing when ebpf/scripts/generate_vmlinux.sh attempted to convert kernel BTF to vmlinux.h header file. The script requires bpftool which was not available in the build environment. Update package installation in three workflow jobs: - Generation Check job - Build Agent Binary jobs (amd64 and arm64) - Build Test Artifacts job
…onships Add 604 lines of unit tests for createNUMADistanceRelationship function, achieving 100% coverage for NUMA distance relationship creation (previously 0% coverage). Tests verify correctness across all real-world NUMA topologies found in production servers and cloud instances. Test implementation covers three phases from issue #162: Phase 1: Basic functionality tests validate relationship creation, predicate marshaling/unmarshaling, type descriptors, and reference handling. Phase 2: Distance value validation tests cover all typical NUMA distances (local=10, remote=20, far=40), edge cases (zero, maximum, negative values), nil reference handling, and self-referential relationships. Phase 3: Real-world NUMA topology scenarios test dual-socket servers, quad-socket configurations, AMD EPYC chiplet architectures, Intel Xeon topologies, eight-socket systems, single-node cloud instances, and cloud provider patterns (AWS c5.metal, GCP n2, Azure L-series). Tests validate bidirectional symmetry and asymmetric distance support. Coverage improvement: 70.9% to 72.2% (+1.3%) createNUMADistanceRelationship: 0% to 100% coverage Closes #162 Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: John Allen <john@antimetal.com>
Fix errcheck lint errors by capturing error returns in NotPanics callbacks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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
This PR adds comprehensive unit tests for NUMA distance relationship creation to address issue #162. The implementation achieves 100% coverage for the previously untested
createNUMADistanceRelationshipfunction with 60+ test cases covering all NUMA topology scenarios found in production servers and cloud instances.What Changed
New Test File
internal/hardware/graph/numa_distance_test.go(646 lines)Test Coverage by Phase
Phase 1: Basic Functionality Tests
Phase 2: Distance Values & Validation
Phase 3: Real-World NUMA Topology Scenarios
Test Statistics
Coverage Achievement
createNUMADistanceRelationship Function:
Overall Package:
All tests passing:
Success Criteria Met
✅ Achieve 100% coverage for createNUMADistanceRelationship
✅ Test all NUMA distance scenarios
✅ Validate proper predicate creation
✅ Test error handling and edge cases
✅ Cover real-world NUMA topologies (Intel, AMD, cloud providers)
Testing
Closes #162
Related