Skip to content

Commit

Permalink
wip2
Browse files Browse the repository at this point in the history
Change-Id: I1438ae4affc31640ae243ce79e6d3f7688b12e41
  • Loading branch information
pintohutch committed Jan 13, 2025
1 parent 9223be9 commit 1808a2b
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions internal/pkg/transformation/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,17 @@ import (
"fmt"
"testing"

"testing"

"github.com/sirupsen/logrus"

mockdeviceinfo "github.com/NVIDIA/dcgm-exporter/internal/mocks/pkg/deviceinfo"

mocknvmlprovider "github.com/NVIDIA/dcgm-exporter/internal/mocks/pkg/nvmlprovider"
"github.com/NVIDIA/go-dcgm/pkg/dcgm"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"google.golang.org/grpc"
podresourcesapi "k8s.io/kubelet/pkg/apis/podresources/v1alpha1"

mockdeviceinfo "github.com/NVIDIA/dcgm-exporter/internal/mocks/pkg/deviceinfo"
mocknvmlprovider "github.com/NVIDIA/dcgm-exporter/internal/mocks/pkg/nvmlprovider"
"github.com/NVIDIA/dcgm-exporter/internal/pkg/appconfig"
"github.com/NVIDIA/dcgm-exporter/internal/pkg/collector"
"github.com/NVIDIA/dcgm-exporter/internal/pkg/counters"
Expand All @@ -46,7 +43,6 @@ import (
func TestProcessPodMapper_WithD_Different_Format_Of_DeviceID(t *testing.T) {
testutils.RequireLinux(t)
logrus.SetLevel(logrus.DebugLevel)

type TestCase struct {
KubernetesGPUIDType appconfig.KubernetesGPUIDType
GPUInstanceID uint
Expand Down Expand Up @@ -130,6 +126,20 @@ func TestProcessPodMapper_WithD_Different_Format_Of_DeviceID(t *testing.T) {
PODGPUIDs: []string{"b8ea3855-276c-c9cb-b366-c6fa655957c5"},
KubernetesVirtualGPU: true,
},
{
KubernetesGPUIDType: appconfig.DeviceName,
ResourceName: appconfig.NvidiaResourceName,
MetricMigProfile: "1g.10gb",
GPUInstanceID: 0,
PODGPUIDs: []string{"nvidia0/gi0/vgpu0"},
},
{
KubernetesGPUIDType: appconfig.DeviceName,
ResourceName: appconfig.NvidiaResourceName,
MetricMigProfile: "1g.10gb",
GPUInstanceID: 1,
PODGPUIDs: []string{"nvidia0/gi1/vgpu0"},
},
{
KubernetesGPUIDType: appconfig.GPUUID,
ResourceName: appconfig.NvidiaResourceName,
Expand Down

0 comments on commit 1808a2b

Please sign in to comment.