git.iko.soy/typeable/bloodhound
on master help sign in
cleaned up deps, bad test config, improved Makefile
commit30028fc5aa861dbca8565b7fe3bf1345064c0d4b authorChris Allen <cma@bitemyapp.com> dateThu 15 May 2014, 08:43 (12 years ago) parent7e4c91b
3 files changed+8−17
Makefile+1 bloodhound.cabal+2−10 tests/tests.hs+5−7
Makefile+1
@@ -5,6 +5,7 @@ install-with-test-support:
55
66test:
77 echo "Make certain you have an elasticsearch instance on localhost:9200 !"
8+ cabal clean
89 cabal test
910
1011build:
bloodhound.cabal+2−10
@@ -30,15 +30,11 @@ library
3030 build-depends: base >= 4.3 && <5,
3131 bytestring >= 0.10.2,
3232 aeson >= 0.7,
33− aeson-pretty >= 0.7,
3433 conduit >= 1.0,
3534 http-conduit >= 2.0,
3635 time >= 1.4,
3736 text >= 0.11,
38− http-types >= 0.8,
39− blaze-builder >= 0.3,
40− unix >= 2.6,
41− scientific
37+ http-types >= 0.8
4238 default-language: Haskell2010
4339
4440test-suite tests
@@ -46,17 +42,13 @@ test-suite tests
4642 default-extensions: OverloadedStrings
4743 type: exitcode-stdio-1.0
4844 main-is: tests.hs
49− -- ghc-options: -w -threaded -rtsopts -with-rtsopts=-N
5045 hs-source-dirs: tests
5146 build-depends: base,
5247 bloodhound,
5348 http-conduit,
5449 http-types,
55− bytestring >= 0.10.2,
5650 hspec >= 1.8,
5751 text >= 0.11,
5852 time >= 1.4,
59− aeson >= 0.7,
60− aeson-pretty >= 0.7,
61− random >= 1.0
53+ aeson >= 0.7
6254 default-language: Haskell2010
tests/tests.hs+5−7
@@ -4,8 +4,6 @@ module Main where
44
55import Database.Bloodhound
66import Data.Aeson
7−-- import Data.Aeson.Encode.Pretty
8−-- import Data.ByteString.Lazy.Char8 (putStrLn)
97import Data.Time.Calendar (Day(..))
108import Data.Time.Clock (secondsToDiffTime, UTCTime(..))
119import Data.Text (Text)
@@ -18,7 +16,7 @@ import Test.Hspec
1816testServer :: Server
1917testServer = Server "http://localhost:9200"
2018testIndex :: IndexName
21−testIndex = IndexName "twitter"
19+testIndex = IndexName "bloodhound-tests-twitter-1"
2220testMapping :: MappingName
2321testMapping = MappingName "tweet"
2422
@@ -133,10 +131,10 @@ main = hspec $ do
133131 _ <- insertData
134132 let firstTest = BulkTest "blah"
135133 let secondTest = BulkTest "bloo"
136− let firstDoc = BulkIndex (IndexName "twitter")
137− (MappingName "tweet") (DocId "2") (object ["name" .= String "blah"])
138− let secondDoc = BulkCreate (IndexName "twitter")
139− (MappingName "tweet") (DocId "3") (object ["name" .= String "bloo"])
134+ let firstDoc = BulkIndex testIndex
135+ testMapping (DocId "2") (object ["name" .= String "blah"])
136+ let secondDoc = BulkCreate testIndex
137+ testMapping (DocId "3") (object ["name" .= String "bloo"])
140138 let stream = [firstDoc, secondDoc]
141139 _ <- bulk testServer stream
142140 _ <- refreshIndex testServer testIndex