tests: add cases for OM text

Signed-off-by: Manik Rana <manikrana54@gmail.com>
This commit is contained in:
Manik Rana 2024-08-30 16:57:06 +05:30
parent 7905fbbae0
commit c58a173382

View file

@ -919,7 +919,16 @@ func TestManagerCTZeroIngestion(t *testing.T) {
require.Equal(t, tc.counterSampleProto.GetValue(), got[0])
case "application/openmetrics-text; version=1.0.0":
if tc.enableCTZeroIngestion && tc.exp.ts == 0 {
require.Len(t, got, 2)
require.Equal(t, tc.exp.value, got[1])
require.Equal(t, 0.0, got[1])
return
}
// Expect only one, valid sample.
require.Len(t, got, 1)
require.Equal(t, tc.exp.value, got[0])
}
})
}