@@ -216,7 +216,7 @@ func verifyModelInspect(t *testing.T, client *desktop.Client, ref, expectedID, e
216216
217217// createAndPushTestModel creates a minimal test model and pushes it to the local registry.
218218// Returns the model ID, FQDNs for host and network access, and the manifest digest.
219- func createAndPushTestModel (t * testing.T , registryURL , modelRef string , contextSize uint64 ) (modelID , hostFQDN , networkFQDN , digest string ) {
219+ func createAndPushTestModel (t * testing.T , registryURL , modelRef string , contextSize * int32 ) (modelID , hostFQDN , networkFQDN , digest string ) {
220220 ctx := context .Background ()
221221
222222 // Use the dummy GGUF file from assets
@@ -234,8 +234,8 @@ func createAndPushTestModel(t *testing.T, registryURL, modelRef string, contextS
234234 require .NoError (t , err )
235235
236236 // Set context size if specified
237- if contextSize > 0 {
238- pkg = pkg .WithContextSize (contextSize )
237+ if contextSize != nil {
238+ pkg = pkg .WithContextSize (* contextSize )
239239 }
240240
241241 // Construct the full reference with the local registry host for pushing from test host
@@ -287,7 +287,7 @@ func TestIntegration_PullModel(t *testing.T) {
287287 // Create and push two test models with different organizations
288288 // Model 1: custom org (test/test-model:latest)
289289 modelRef1 := "test/test-model:latest"
290- modelID1 , hostFQDN1 , networkFQDN1 , digest1 := createAndPushTestModel (t , env .registryURL , modelRef1 , 2048 )
290+ modelID1 , hostFQDN1 , networkFQDN1 , digest1 := createAndPushTestModel (t , env .registryURL , modelRef1 , int32ptr ( 2048 ) )
291291 t .Logf ("Test model 1 pushed: %s (ID: %s) FQDN: %s Digest: %s" , hostFQDN1 , modelID1 , networkFQDN1 , digest1 )
292292
293293 // Generate test cases for custom org model (test/test-model)
@@ -304,7 +304,7 @@ func TestIntegration_PullModel(t *testing.T) {
304304
305305 // Model 2: default org (ai/test-model:latest)
306306 modelRef2 := "ai/test-model:latest"
307- modelID2 , hostFQDN2 , networkFQDN2 , digest2 := createAndPushTestModel (t , env .registryURL , modelRef2 , 2048 )
307+ modelID2 , hostFQDN2 , networkFQDN2 , digest2 := createAndPushTestModel (t , env .registryURL , modelRef2 , int32ptr ( 2048 ) )
308308 t .Logf ("Test model 2 pushed: %s (ID: %s) FQDN: %s Digest: %s" , hostFQDN2 , modelID2 , networkFQDN2 , digest2 )
309309
310310 // Generate test cases for default org model (ai/test-model)
@@ -420,7 +420,7 @@ func TestIntegration_InspectModel(t *testing.T) {
420420
421421 // Create and push a test model with default org (ai/inspect-test:latest)
422422 modelRef := "ai/inspect-test:latest"
423- modelID , hostFQDN , networkFQDN , digest := createAndPushTestModel (t , env .registryURL , modelRef , 2048 )
423+ modelID , hostFQDN , networkFQDN , digest := createAndPushTestModel (t , env .registryURL , modelRef , int32ptr ( 2048 ) )
424424 t .Logf ("Test model pushed: %s (ID: %s) FQDN: %s Digest: %s" , hostFQDN , modelID , networkFQDN , digest )
425425
426426 // Pull the model using a short reference
@@ -479,7 +479,7 @@ func TestIntegration_TagModel(t *testing.T) {
479479
480480 // Create and push a test model with default org (ai/tag-test:latest)
481481 modelRef := "ai/tag-test:latest"
482- modelID , hostFQDN , networkFQDN , digest := createAndPushTestModel (t , env .registryURL , modelRef , 2048 )
482+ modelID , hostFQDN , networkFQDN , digest := createAndPushTestModel (t , env .registryURL , modelRef , int32ptr ( 2048 ) )
483483 t .Logf ("Test model pushed: %s (ID: %s) FQDN: %s Digest: %s" , hostFQDN , modelID , networkFQDN , digest )
484484
485485 // Pull the model using a simple reference
@@ -657,7 +657,7 @@ func TestIntegration_PushModel(t *testing.T) {
657657
658658 // Create and push a test model with default org (ai/tag-test:latest)
659659 modelRef := "ai/tag-test:latest"
660- modelID , hostFQDN , networkFQDN , digest := createAndPushTestModel (t , env .registryURL , modelRef , 2048 )
660+ modelID , hostFQDN , networkFQDN , digest := createAndPushTestModel (t , env .registryURL , modelRef , int32ptr ( 2048 ) )
661661 t .Logf ("Test model pushed: %s (ID: %s) FQDN: %s Digest: %s" , hostFQDN , modelID , networkFQDN , digest )
662662
663663 // Pull the model using a simple reference
@@ -791,7 +791,7 @@ func TestIntegration_RemoveModel(t *testing.T) {
791791
792792 // Create and push a test model with default org (ai/rm-test:latest)
793793 modelRef := "ai/rm-test:latest"
794- modelID , hostFQDN , networkFQDN , digest := createAndPushTestModel (t , env .registryURL , modelRef , 2048 )
794+ modelID , hostFQDN , networkFQDN , digest := createAndPushTestModel (t , env .registryURL , modelRef , int32ptr ( 2048 ) )
795795 t .Logf ("Test model pushed: %s (ID: %s) FQDN: %s Digest: %s" , hostFQDN , modelID , networkFQDN , digest )
796796
797797 // Generate all reference test cases
@@ -842,9 +842,9 @@ func TestIntegration_RemoveModel(t *testing.T) {
842842 t .Run ("remove multiple models" , func (t * testing.T ) {
843843 // Create and push two different models
844844 modelRef1 := "ai/rm-multi-1:latest"
845- modelID1 , _ , _ , _ := createAndPushTestModel (t , env .registryURL , modelRef1 , 2048 )
845+ modelID1 , _ , _ , _ := createAndPushTestModel (t , env .registryURL , modelRef1 , int32ptr ( 2048 ) )
846846 modelRef2 := "ai/rm-multi-2:latest"
847- modelID2 , _ , _ , _ := createAndPushTestModel (t , env .registryURL , modelRef2 , 2048 )
847+ modelID2 , _ , _ , _ := createAndPushTestModel (t , env .registryURL , modelRef2 , int32ptr ( 2048 ) )
848848
849849 // Pull both models
850850 t .Logf ("Pulling first model: rm-multi-1" )
@@ -1014,3 +1014,7 @@ func TestIntegration_RemoveModel(t *testing.T) {
10141014 })
10151015 })
10161016}
1017+
1018+ func int32ptr (n int32 ) * int32 {
1019+ return & n
1020+ }
0 commit comments