Closed (fixed)
Project:
Monitoring
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
11 Apr 2016 at 14:24 UTC
Updated:
19 Aug 2016 at 15:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
a.milkovskyComment #3
fagoThis should mention it's a straight port of #2684191: [Needs tests] Sensors ignore thresholds of 0. Anyway, code is fine!
Comment #4
alecsmrekar commentedI have added some tests to make sure the exceeds and falls methods use type safe threshold values.
Note that test_only.patch contains only my changes.
Comment #7
berdirDon't worry about the other test fails, I think we have some head test fails there, you can ignore those.
Comment #8
tduong commentedCool! :) I'm currently working on #2775173: getEntityQueryAggregate() gets unneeded parameters that might fix the failing tests...
In the meantime, just some nitpicks for you:
Too long, should be in max 80 chars. Maybe something like "Tests if thresholds checks are type safe, especially for zero values." (?)
Use the new array syntax where you add them, according to the array std coding ;)
I'm wondering if it's better to extend the existing 4 test methods for these 4 thresholds method check cases instead to have a specific test... If we want to keep this new test method, then maybe we should also add the last two cases (inner/outer intervals) as well .. ?
And please assign this issue to yourself since you are working on it, @alecsmrekar ;)
Comment #9
alecsmrekar commentedI think it's not really possible to test the inner and outer intervals as their thresholds can not be set to 0 (fails validation).
Comment #10
alecsmrekar commentedHere is the code with arrays reformatted and the code moved back to the existing methods.
Comment #13
berdirAnd already new test fails :( (still not your problem)
Test looks good, nice work so far. Lets add one more example in each test for a boundary scenario, meaning, when the value is 0 so that we are sure that it works as expected.
Comment #14
alecsmrekar commentedAdded exceeds and falls test with value 0 and thresholds 0.
Comment #15
tduong commentedGreat job! :)
One last thing, can you upload also an interdiff between your patchs please ?
Comment #16
alecsmrekar commentedInterdiff attached.
Comment #17
tduong commentedAlright, looks nice :)
Comment #19
berdirAgreed, thanks!