(t *testing.T)
| 45 | } |
| 46 | |
| 47 | func TestGPUCounts(t *testing.T) { |
| 48 | s := testSpecStore() |
| 49 | |
| 50 | tests := []struct { |
| 51 | name string |
| 52 | gpuType string |
| 53 | expected []int |
| 54 | }{ |
| 55 | { |
| 56 | name: "a6000 only has 1 GPU", |
| 57 | gpuType: "a6000", |
| 58 | expected: []int{1}, |
| 59 | }, |
| 60 | { |
| 61 | name: "a100xl has 1, 2, 4, and 8 GPUs", |
| 62 | gpuType: "a100xl", |
| 63 | expected: []int{1, 2, 4, 8}, |
| 64 | }, |
| 65 | { |
| 66 | name: "unknown GPU returns nil", |
| 67 | gpuType: "unknown", |
| 68 | expected: nil, |
| 69 | }, |
| 70 | } |
| 71 | |
| 72 | for _, tt := range tests { |
| 73 | t.Run(tt.name, func(t *testing.T) { |
| 74 | got := s.GPUCounts(tt.gpuType) |
| 75 | assert.Equal(t, tt.expected, got) |
| 76 | }) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | func TestNeedsGPUCountPhase(t *testing.T) { |
| 81 | s := testSpecStore() |
nothing calls this directly
no test coverage detected