git.iko.soy/typeable/bloodhound
on master help sign in
add tests for compression
b488c45Andrew Martin
tests/V5/tests.hs+20
@@ -914,6 +914,7 @@ instance Arbitrary AnalyzerDefinition where arbitrary = sopArbitrary; shrink = g
914instance Arbitrary Analysis where arbitrary = sopArbitrary; shrink = genericShrink
914instance Arbitrary Analysis where arbitrary = sopArbitrary; shrink = genericShrink
915instance Arbitrary Tokenizer where arbitrary = sopArbitrary; shrink = genericShrink
915instance Arbitrary Tokenizer where arbitrary = sopArbitrary; shrink = genericShrink
916instance Arbitrary UpdatableIndexSetting where arbitrary = sopArbitrary; shrink = genericShrink
916instance Arbitrary UpdatableIndexSetting where arbitrary = sopArbitrary; shrink = genericShrink
917+instance Arbitrary Compression where arbitrary = sopArbitrary; shrink = genericShrink
917instance Arbitrary Bytes where arbitrary = sopArbitrary; shrink = genericShrink
918instance Arbitrary Bytes where arbitrary = sopArbitrary; shrink = genericShrink
918instance Arbitrary AllocationPolicy where arbitrary = sopArbitrary; shrink = genericShrink
919instance Arbitrary AllocationPolicy where arbitrary = sopArbitrary; shrink = genericShrink
919instance Arbitrary InitialShardCount where arbitrary = sopArbitrary; shrink = genericShrink
920instance Arbitrary InitialShardCount where arbitrary = sopArbitrary; shrink = genericShrink
@@ -1648,6 +1649,25 @@ main = hspec $ do
1648 updates
1649 updates
1649 )
1650 )
1650
1651
1652+ it "accepts default compression codec" $ when' (atleast es50) $ withTestEnv $ do
1653+ _ <- deleteExampleIndex
1654+ let updates = [CompressionSetting CompressionDefault]
1655+ createResp <- createIndexWith (updates ++ [NumberOfReplicas (ReplicaCount 0)]) 1 testIndex
1656+ liftIO $ validateStatus createResp 200
1657+ getResp <- getIndexSettings testIndex
1658+ liftIO $ getResp `shouldBe` Right
1659+ (IndexSettingsSummary testIndex (IndexSettings (ShardCount 1) (ReplicaCount 0)) updates)
1660+
1661+ it "accepts best compression codec" $ when' (atleast es50) $ withTestEnv $ do
1662+ _ <- deleteExampleIndex
1663+ let updates = [CompressionSetting CompressionBest]
1664+ createResp <- createIndexWith (updates ++ [NumberOfReplicas (ReplicaCount 0)]) 1 testIndex
1665+ liftIO $ validateStatus createResp 200
1666+ getResp <- getIndexSettings testIndex
1667+ liftIO $ getResp `shouldBe` Right
1668+ (IndexSettingsSummary testIndex (IndexSettings (ShardCount 1) (ReplicaCount 0)) updates)
1669+
1670+
1651 describe "Index Optimization" $ do
1671 describe "Index Optimization" $ do
1652 it "returns a successful response upon completion" $ withTestEnv $ do
1672 it "returns a successful response upon completion" $ withTestEnv $ do
1653 _ <- createExampleIndex
1673 _ <- createExampleIndex