more specific sub-agg test; updated plain stack.yaml

This commit is contained in:
Josh Berman 2017-01-30 12:05:29 +02:00
parent 895df29b9f
commit 576e25dfb3
3 changed files with 7 additions and 14 deletions

View File

@ -3,13 +3,4 @@ packages:
- '.'
extra-deps:
- quickcheck-properties-0.1
# - http-client-0.5.0
# - fail-4.9.0.0
# - http-types-0.9
# - attoparsec-0.13.0.1
# - doctest-0.10.1
# - semigroups-0.18.0.1
# - uri-bytestring-0.1.9
# - temporary-resourcet-0.1.0.0
resolver: nightly-2016-08-20
resolver: nightly-2017-01-30

View File

@ -1314,8 +1314,9 @@ main = hspec $ do
reply <- searchByIndex testIndex search
let result = decode (responseBody reply) :: Maybe (SearchResult Tweet)
usersAggResults = result >>= aggregations >>= toTerms "users"
subAddResultsExists = maybe (Left False) Right $ ((isJust . termsAggs . head . buckets) <$> usersAggResults)
liftIO $ (subAddResultsExists) `shouldBe` Right True
subAggResults = usersAggResults >>= (listToMaybe . buckets) >>= termsAggs >>= toTerms "age_agg"
subAddResultsExists = isJust subAggResults
liftIO $ (subAddResultsExists) `shouldBe` True
it "returns cardinality aggregation results" $ withTestEnv $ do
_ <- insertData

View File

@ -1129,8 +1129,9 @@ main = hspec $ do
reply <- searchByIndex testIndex search
let result = decode (responseBody reply) :: Maybe (SearchResult Tweet)
usersAggResults = result >>= aggregations >>= toTerms "users"
subAddResultsExists = maybe (Left False) Right $ ((isJust . termsAggs . head . buckets) <$> usersAggResults)
liftIO $ (subAddResultsExists) `shouldBe` Right True
subAggResults = usersAggResults >>= (listToMaybe . buckets) >>= termsAggs >>= toTerms "age_agg"
subAddResultsExists = isJust subAggResults
liftIO $ (subAddResultsExists) `shouldBe` True
it "returns cardinality aggregation results" $ withTestEnv $ do
_ <- insertData