-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Fold + Env to allow for filters for instance status #10
Conversation
I'm not sure how this is supposed to work. Say you have events:
and Can you put an example here so we can see? |
Ah, I see. It's a bit convoluted, I can't think of a cleaner way on the top of my head. Regardless, could you add some quickcheck tests, for both instance flavors and non-flavor resources? |
if we have quickcheck tests, we can formulate exactly what we're expecting here. |
Shall do |
tests/SampleData has all the Arbitrary & friends instances |
I think this needs a minor bump? |
v <- M.lookup k fullResult | ||
v' <- M.lookup k filteredResult | ||
return $ v' <= v) filteredKeys | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you put a short comment describing this property -- something to the effect of "filtered results must be subset of ... and all filtered values are less than corresponding values in full results"
then please merge.
sign-off. |
$ L.fold foldInstanceFlavor flavorTimedPDs `shouldBe` M.fromList flavorTimedPDsResult | ||
$ L.fold (foldInstanceFlavor $ const True) flavorTimedPDs `shouldBe` M.fromList flavorTimedPDsResult | ||
|
||
describe "Filtering instance statuses is sane" $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This use of "describe" is odd - normally, describe is used to name the thing which is described by the tests, not assert that the thing is sane.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe "filtering instance statuses" $
prop "is sane" ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
Update Fold + Env to allow for filters for instance status
Add a 'Filters' to the Env to supply ceilometer-common with a predicate to filter Instance metrics based on status.