@@ -250,7 +250,7 @@ func TestConvertPrometheusMetricFamilies(t *testing.T) {
250250 metricName := "test_histogram"
251251 sampleCount := uint64 (100 )
252252 sampleSum := 250.5
253-
253+
254254 // Create histogram buckets
255255 buckets := []* dto.Bucket {
256256 {
@@ -334,20 +334,20 @@ func TestConvertPrometheusMetricFamilies(t *testing.T) {
334334
335335 // Verify bucket timeseries (4 explicit buckets + 1 +Inf bucket)
336336 r .Len (bucketTimeseries , 5 )
337-
337+
338338 // Verify each expected bucket exists
339339 expectedBuckets := map [string ]float64 {
340- "1.000000" : 10 ,
341- "5.000000" : 30 ,
340+ "1.000000" : 10 ,
341+ "5.000000" : 30 ,
342342 "10.000000" : 80 ,
343343 "25.000000" : 100 ,
344- "+Inf" : 100 ,
344+ "+Inf" : 100 ,
345345 }
346346
347347 foundBuckets := make (map [string ]bool )
348348 for _ , ts := range bucketTimeseries {
349349 assertLabelPresent (t , ts .Labels , "__name__" , metricName + "_bucket" )
350-
350+
351351 // Find the 'le' label value
352352 var leValue string
353353 for _ , label := range ts .Labels {
@@ -356,38 +356,42 @@ func TestConvertPrometheusMetricFamilies(t *testing.T) {
356356 break
357357 }
358358 }
359-
359+
360360 r .NotEmpty (leValue , "Bucket timeseries should have 'le' label" )
361-
361+
362362 expectedCount , exists := expectedBuckets [leValue ]
363363 r .True (exists , "Unexpected bucket with le=%s" , leValue )
364364 r .Equal (expectedCount , ts .Samples [0 ].Value )
365365 foundBuckets [leValue ] = true
366366 }
367-
367+
368368 // Ensure all expected buckets were found
369369 r .Len (foundBuckets , len (expectedBuckets ))
370370
371371 // Verify _sum timeseries
372372 r .NotNil (sumTimeseries )
373373 assertLabelPresent (t , sumTimeseries .Labels , "__name__" , metricName + "_sum" )
374374 r .Equal (sampleSum , sumTimeseries .Samples [0 ].Value )
375-
375+
376376 // Verify _sum doesn't have 'le' label
377377 for _ , label := range sumTimeseries .Labels {
378378 r .NotEqual ("le" , label .Name , "_sum should not have 'le' label" )
379379 }
380380
381- // Verify _count timeseries
381+ // Verify _count timeseries
382382 r .NotNil (countTimeseries )
383383 assertLabelPresent (t , countTimeseries .Labels , "__name__" , metricName + "_count" )
384384 r .Equal (float64 (sampleCount ), countTimeseries .Samples [0 ].Value )
385-
385+
386386 // Verify _count doesn't have 'le' label
387387 for _ , label := range countTimeseries .Labels {
388388 r .NotEqual ("le" , label .Name , "_count should not have 'le' label" )
389389 }
390390 })
391+
392+ t .Run ("summary" , func (t * testing.T ) {
393+ // TODO: unit test for summary metrics
394+ })
391395}
392396
393397func assertLabelPresent (t * testing.T , labels []PrometheusLabel , name , value string ) {
0 commit comments