@@ -872,6 +872,83 @@ func TestSpecToHelmValues_GCConfig(t *testing.T) {
872872 }
873873}
874874
875+ func TestSpecToHelmValues_ProcessorHeartbeatInterval (t * testing.T ) {
876+ gw := minimalGateway ()
877+ gw .Spec .Processor .Config = & batchv1alpha1.ProcessorConfigSpec {
878+ HeartbeatInterval : "5m" ,
879+ }
880+
881+ vals := specToBatchHelmValues (gw , testSecretName (gw ), testImages ())
882+
883+ processor := vals ["processor" ].(map [string ]interface {})
884+ config := processor ["config" ].(map [string ]interface {})
885+ if got := config ["heartbeatInterval" ]; got != "5m" {
886+ t .Errorf ("heartbeatInterval = %v, want 5m" , got )
887+ }
888+ }
889+
890+ func TestSpecToHelmValues_GCReconciler (t * testing.T ) {
891+ gw := minimalGateway ()
892+ gw .Spec .GC .Config = & batchv1alpha1.GCConfigSpec {
893+ Reconciler : & batchv1alpha1.ReconcilerSpec {
894+ Enabled : true ,
895+ Interval : "60m" ,
896+ },
897+ }
898+
899+ vals := specToBatchHelmValues (gw , testSecretName (gw ), testImages ())
900+
901+ gc := vals ["gc" ].(map [string ]interface {})
902+ config := gc ["config" ].(map [string ]interface {})
903+ reconciler , ok := config ["reconciler" ].(map [string ]interface {})
904+ if ! ok {
905+ t .Fatalf ("reconciler not found or wrong type: %T" , config ["reconciler" ])
906+ }
907+ if got := reconciler ["enabled" ]; got != true {
908+ t .Errorf ("reconciler.enabled = %v, want true" , got )
909+ }
910+ if got := reconciler ["interval" ]; got != "60m" {
911+ t .Errorf ("reconciler.interval = %v, want 60m" , got )
912+ }
913+ }
914+
915+ func TestSpecToHelmValues_GCReconcilerDisabled (t * testing.T ) {
916+ gw := minimalGateway ()
917+ gw .Spec .GC .Config = & batchv1alpha1.GCConfigSpec {
918+ Reconciler : & batchv1alpha1.ReconcilerSpec {},
919+ }
920+
921+ vals := specToBatchHelmValues (gw , testSecretName (gw ), testImages ())
922+
923+ gc := vals ["gc" ].(map [string ]interface {})
924+ config := gc ["config" ].(map [string ]interface {})
925+ reconciler , ok := config ["reconciler" ].(map [string ]interface {})
926+ if ! ok {
927+ t .Fatalf ("reconciler not found or wrong type: %T" , config ["reconciler" ])
928+ }
929+ if got := reconciler ["enabled" ]; got != false {
930+ t .Errorf ("reconciler.enabled = %v, want false" , got )
931+ }
932+ if _ , hasInterval := reconciler ["interval" ]; hasInterval {
933+ t .Errorf ("reconciler.interval should be absent when not set, got %v" , reconciler ["interval" ])
934+ }
935+ }
936+
937+ func TestSpecToHelmValues_GCReconcilerNil (t * testing.T ) {
938+ gw := minimalGateway ()
939+ gw .Spec .GC .Config = & batchv1alpha1.GCConfigSpec {}
940+
941+ vals := specToBatchHelmValues (gw , testSecretName (gw ), testImages ())
942+
943+ gc := vals ["gc" ].(map [string ]interface {})
944+ if _ , hasConfig := gc ["config" ]; hasConfig {
945+ config := gc ["config" ].(map [string ]interface {})
946+ if _ , hasReconciler := config ["reconciler" ]; hasReconciler {
947+ t .Error ("reconciler should not be present when Reconciler is nil" )
948+ }
949+ }
950+ }
951+
875952func TestSpecToHelmValues_InferenceGatewayMaxRetries (t * testing.T ) {
876953 maxRetries := int32 (3 )
877954 gw := minimalGateway ()
0 commit comments