git.iko.soy/typeable/bloodhound
on master help sign in
cleaned up deps, bad test config, improved Makefile
30028fcChris Allen
@@ -5,6 +5,7 @@ install-with-test-support:
5
5
6test:
6test:
7 echo "Make certain you have an elasticsearch instance on localhost:9200 !"
7 echo "Make certain you have an elasticsearch instance on localhost:9200 !"
8+ cabal clean
8 cabal test
9 cabal test
9
10
10build:
11build:
bloodhound.cabal+2−10
@@ -30,15 +30,11 @@ library
30 build-depends: base >= 4.3 && <5,
30 build-depends: base >= 4.3 && <5,
31 bytestring >= 0.10.2,
31 bytestring >= 0.10.2,
32 aeson >= 0.7,
32 aeson >= 0.7,
33− aeson-pretty >= 0.7,
34 conduit >= 1.0,
33 conduit >= 1.0,
35 http-conduit >= 2.0,
34 http-conduit >= 2.0,
36 time >= 1.4,
35 time >= 1.4,
37 text >= 0.11,
36 text >= 0.11,
38− http-types >= 0.8,
37+ http-types >= 0.8
39− blaze-builder >= 0.3,
40− unix >= 2.6,
41− scientific
42 default-language: Haskell2010
38 default-language: Haskell2010
43
39
44test-suite tests
40test-suite tests
@@ -46,17 +42,13 @@ test-suite tests
46 default-extensions: OverloadedStrings
42 default-extensions: OverloadedStrings
47 type: exitcode-stdio-1.0
43 type: exitcode-stdio-1.0
48 main-is: tests.hs
44 main-is: tests.hs
49− -- ghc-options: -w -threaded -rtsopts -with-rtsopts=-N
50 hs-source-dirs: tests
45 hs-source-dirs: tests
51 build-depends: base,
46 build-depends: base,
52 bloodhound,
47 bloodhound,
53 http-conduit,
48 http-conduit,
54 http-types,
49 http-types,
55− bytestring >= 0.10.2,
56 hspec >= 1.8,
50 hspec >= 1.8,
57 text >= 0.11,
51 text >= 0.11,
58 time >= 1.4,
52 time >= 1.4,
59− aeson >= 0.7,
53+ aeson >= 0.7
60− aeson-pretty >= 0.7,
61− random >= 1.0
62 default-language: Haskell2010
54 default-language: Haskell2010
tests/tests.hs+5−7
@@ -4,8 +4,6 @@ module Main where
4
4
5import Database.Bloodhound
5import Database.Bloodhound
6import Data.Aeson
6import Data.Aeson
7−-- import Data.Aeson.Encode.Pretty
8−-- import Data.ByteString.Lazy.Char8 (putStrLn)
9import Data.Time.Calendar (Day(..))
7import Data.Time.Calendar (Day(..))
10import Data.Time.Clock (secondsToDiffTime, UTCTime(..))
8import Data.Time.Clock (secondsToDiffTime, UTCTime(..))
11import Data.Text (Text)
9import Data.Text (Text)
@@ -18,7 +16,7 @@ import Test.Hspec
18testServer :: Server
16testServer :: Server
19testServer = Server "http://localhost:9200"
17testServer = Server "http://localhost:9200"
20testIndex :: IndexName
18testIndex :: IndexName
21−testIndex = IndexName "twitter"
19+testIndex = IndexName "bloodhound-tests-twitter-1"
22testMapping :: MappingName
20testMapping :: MappingName
23testMapping = MappingName "tweet"
21testMapping = MappingName "tweet"
24
22
@@ -133,10 +131,10 @@ main = hspec $ do
133 _ <- insertData
131 _ <- insertData
134 let firstTest = BulkTest "blah"
132 let firstTest = BulkTest "blah"
135 let secondTest = BulkTest "bloo"
133 let secondTest = BulkTest "bloo"
136− let firstDoc = BulkIndex (IndexName "twitter")
134+ let firstDoc = BulkIndex testIndex
137− (MappingName "tweet") (DocId "2") (object ["name" .= String "blah"])
135+ testMapping (DocId "2") (object ["name" .= String "blah"])
138− let secondDoc = BulkCreate (IndexName "twitter")
136+ let secondDoc = BulkCreate testIndex
139− (MappingName "tweet") (DocId "3") (object ["name" .= String "bloo"])
137+ testMapping (DocId "3") (object ["name" .= String "bloo"])
140 let stream = [firstDoc, secondDoc]
138 let stream = [firstDoc, secondDoc]
141 _ <- bulk testServer stream
139 _ <- bulk testServer stream
142 _ <- refreshIndex testServer testIndex
140 _ <- refreshIndex testServer testIndex