test(gpu): add e2e tests with fake NVML library#2421
Open
vimalk78 wants to merge 1 commit intosustainable-computing-io:mainfrom
Open
test(gpu): add e2e tests with fake NVML library#2421vimalk78 wants to merge 1 commit intosustainable-computing-io:mainfrom
vimalk78 wants to merge 1 commit intosustainable-computing-io:mainfrom
Conversation
Introduce a fake libnvidia-ml.so.1 (C shared library) that go-nvml
loads via dlopen, returning canned GPU data from a JSON config file.
This enables testing the full GPU metrics pipeline without real
NVIDIA hardware.
- fake_nvml.c: 44 NVML symbols, reads config from FAKE_NVML_CONFIG env
- cJSON vendored (MIT) for JSON parsing in C
- 7 test cases: discovery, power, idle, process attribution, multi-GPU,
energy consistency, graceful degradation
- Makefile test-e2e-gpu target
- Documentation in docs/developer/e2e-testing.md
Signed-off-by: Vimal Kumar <vimal78@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2421 +/- ##
=======================================
Coverage 91.72% 91.72%
=======================================
Files 54 54
Lines 5270 5270
=======================================
Hits 4834 4834
Misses 316 316
Partials 120 120 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
@vimalk78 Will this help in case of k8s env as well? |
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.
Introduce a fake libnvidia-ml.so.1 (C shared library) that go-nvml
loads via dlopen, returning canned GPU data from a JSON config file.
This enables testing the full GPU metrics pipeline without real
NVIDIA hardware.