@@ -258,3 +258,59 @@ test.new(std.thisFile)
258258 }
259259 )
260260)
261+ + test.case.new(
262+ name='showClassicHistogramQuery defaults' ,
263+ test=test.expect.eq(
264+ actual=utils.showClassicHistogramQuery({ classic: 'foo' }),
265+ expected='(foo) and on() (vector($latency_metrics) == 1)' ,
266+ )
267+ )
268+ + test.case.new(
269+ name='showClassicHistogramQuery other variable' ,
270+ test=test.expect.eq(
271+ actual=utils.showClassicHistogramQuery({ classic: 'foo' }, dashboard_variable='my_var' ),
272+ expected='(foo) and on() (vector($my_var) == 1)' ,
273+ )
274+ )
275+ + test.case.new(
276+ name='showClassicHistogramQuery disable' ,
277+ test=test.expect.eq(
278+ actual=utils.showClassicHistogramQuery({ classic: 'foo' }, disable=true ),
279+ expected='(foo) and on() (vector(1) == 1)' ,
280+ )
281+ )
282+ + test.case.new(
283+ name='showClassicHistogramQuery disable ignore dashboard variable' ,
284+ test=test.expect.eq(
285+ actual=utils.showClassicHistogramQuery({ classic: 'foo' }, dashboard_variable='my_var' , disable=true ),
286+ expected='(foo) and on() (vector(1) == 1)' ,
287+ )
288+ )
289+ + test.case.new(
290+ name='showNativeHistogramQuery defaults' ,
291+ test=test.expect.eq(
292+ actual=utils.showNativeHistogramQuery({ native: 'foo' }),
293+ expected='(foo) and on() (vector($latency_metrics) == -1)' ,
294+ )
295+ )
296+ + test.case.new(
297+ name='showNativeHistogramQuery other variable' ,
298+ test=test.expect.eq(
299+ actual=utils.showNativeHistogramQuery({ native: 'foo' }, dashboard_variable='my_var' ),
300+ expected='(foo) and on() (vector($my_var) == -1)' ,
301+ )
302+ )
303+ + test.case.new(
304+ name='showNativeHistogramQuery disable' ,
305+ test=test.expect.eq(
306+ actual=utils.showNativeHistogramQuery({ native: 'foo' }, disable=true ),
307+ expected='(foo) and on() (vector(1) == -1)' ,
308+ )
309+ )
310+ + test.case.new(
311+ name='showNativeHistogramQuery disable ignore dashboard variable' ,
312+ test=test.expect.eq(
313+ actual=utils.showNativeHistogramQuery({ native: 'foo' }, dashboard_variable='my_var' , disable=true ),
314+ expected='(foo) and on() (vector(1) == -1)' ,
315+ )
316+ )
0 commit comments