Skip to content

Commit

Permalink
Fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
tiopramayudi committed Nov 25, 2024
1 parent f5e57ae commit c2bcce2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions api/storage/version_endpoint_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"gorm.io/gorm"
"k8s.io/apimachinery/pkg/api/resource"

"github.com/caraml-dev/merlin/database"
"github.com/caraml-dev/merlin/models"
Expand Down Expand Up @@ -122,9 +123,11 @@ func TestVersionEndpointsStorage_GetModelObservability(t *testing.T) {
}
assert.Equal(t, expectedGroundTruthob, modelObservability.GroundTruthJob)

cpuQuantity := resource.MustParse("1")
memoryQuantity := resource.MustParse("1Gi")
expectedPredictionLogIngestionResourceRequest := &models.WorkerResourceRequest{
CPURequest: "1",
MemoryRequest: "1Gi",
CPURequest: &cpuQuantity,
MemoryRequest: &memoryQuantity,
Replica: 1,
}
assert.Equal(t, expectedPredictionLogIngestionResourceRequest, modelObservability.PredictionLogIngestionResourceRequest)
Expand Down Expand Up @@ -213,6 +216,8 @@ func populateVersionEndpointTable(db *gorm.DB) []*models.VersionEndpoint {
Protocol: protocol.HttpJson,
}
db.Create(&ep2)
cpuQuantity := resource.MustParse("1")
memoryQuantity := resource.MustParse("1Gi")
ep3 := models.VersionEndpoint{
ID: uuid.New(),
VersionID: v.ID,
Expand Down Expand Up @@ -243,8 +248,8 @@ func populateVersionEndpointTable(db *gorm.DB) []*models.VersionEndpoint {
ServiceAccountSecretName: "service_account_secret_name",
},
PredictionLogIngestionResourceRequest: &models.WorkerResourceRequest{
CPURequest: "1",
MemoryRequest: "1Gi",
CPURequest: &cpuQuantity,
MemoryRequest: &memoryQuantity,
Replica: 1,
},
},
Expand Down

0 comments on commit c2bcce2

Please sign in to comment.