mirror of
https://github.com/typeable/bloodhound.git
synced 2024-12-02 14:34:23 +03:00
Loosen IndexAliasesSummary
Looks like 1.4.1 produces different outputs (namely an empty object instead of {aliases: null}), even though 1.4.5 does the right thing. This should hopefully clear up the one sticking case in the travis build.
This commit is contained in:
parent
8a8492dfdd
commit
10666e6b17
@ -3069,7 +3069,7 @@ instance FromJSON IndexAliasesSummary where
|
||||
parseJSON = withObject "IndexAliasesSummary" parse
|
||||
where parse o = IndexAliasesSummary . mconcat <$> mapM (uncurry go) (HM.toList o)
|
||||
go ixn = withObject "index aliases" $ \ia -> do
|
||||
aliases <- ia .: "aliases"
|
||||
aliases <- ia .:? "aliases" .!= mempty
|
||||
forM (HM.toList aliases) $ \(aName, v) -> do
|
||||
let indexAlias = IndexAlias (IndexName ixn) (IndexAliasName (IndexName aName))
|
||||
IndexAliasSummary indexAlias <$> parseJSON v
|
||||
|
@ -1350,7 +1350,7 @@ main = hspec $ do
|
||||
withTestEnv $ do
|
||||
resetIndex
|
||||
resp <- updateIndexAliases (action :| [])
|
||||
liftIO $ NHTS.statusCode (responseStatus resp) `shouldBe` 200
|
||||
liftIO $ validateStatus resp 200
|
||||
let cleanup = withTestEnv (updateIndexAliases (RemoveAlias alias :| []))
|
||||
(do aliases <- withTestEnv getIndexAliases
|
||||
let expected = IndexAliasSummary alias create
|
||||
@ -1371,7 +1371,7 @@ main = hspec $ do
|
||||
withTestEnv $ do
|
||||
resetIndex
|
||||
resp <- updateIndexAliases (action :| [])
|
||||
liftIO $ NHTS.statusCode (responseStatus resp) `shouldBe` 200
|
||||
liftIO $ validateStatus resp 200
|
||||
let cleanup = withTestEnv (updateIndexAliases (RemoveAlias alias :| []))
|
||||
(do aliases <- withTestEnv getIndexAliases
|
||||
let expected = IndexAliasSummary alias create
|
||||
|
Loading…
Reference in New Issue
Block a user