Skip to content

[Feature]: Add mock tests for AMD rocm-smi hardware discovery #15

Description

@pipe1os

Problem Description

In hardware.py, the --gpu auto flag runs subprocess.run(["rocm-smi", "--showmeminfo", "vram"]) to dynamically detect AMD GPUs. This path is currently completely untested because GitHub Actions runners don't have AMD GPUs.

Proposed Solution

  1. In tests/test_hardware.py (you will need to create this file), use unittest.mock.patch to mock subprocess.run.
  2. Feed the mock a sample string output of what rocm-smi --showmeminfo vram actually produces.
  3. Assert that detect_local_gpu() correctly parses the string, identifies the GPU count, and returns the correct AMD VRAM in GB.

Alternatives Considered

None.

Additional Context

Requires Python mocking knowledge to simulate the system call, but adds immense value to the robustness of our AMD support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions