Skip to content

Commit

Permalink
Migrate to the tasty framework for running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dogonthehorizon committed Aug 29, 2017
1 parent cfa66ab commit b4b5fd1
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 24 deletions.
34 changes: 19 additions & 15 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ library:
- Bartlett.Actions.Artifact
- Bartlett.Actions.Log
dependencies:
- wreq
- aeson
- aeson-pretty
- case-insensitive
- configurator
- filepath
- http-client
- http-types
- lens
- optparse-applicative
- aeson
- aeson-pretty
- lens-aeson
- text
- http-types
- http-client
- uri-bytestring
- case-insensitive
- mtl
- optparse-applicative
- text
- transformers
- uri-bytestring
- wreq
executables:
bartlett:
main: app/Main.hs
Expand All @@ -61,24 +61,28 @@ executables:
- -optl-pthread
dependencies:
- bartlett
- optparse-applicative
- keyring
- mtl
- optparse-applicative
tests:
bartlett-test:
main: Spec.hs
main: Tasty.hs
source-dirs: test
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- hscolour
- aeson
- bartlett
- either-unwrap
- hspec
- aeson
- wreq
- http-types
- lens
- smallcheck
- tasty
- tasty-discover
- tasty-hspec
- tasty-smallcheck
- uri-bytestring
- either-unwrap
- wreq
4 changes: 1 addition & 3 deletions test/Bartlett/Actions/InfoSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import Test.Hspec
-- TODO figure out how to mock some HTTP request action
-- this might be a good resource: https://github.com/bos/wreq/blob/master/tests/UnitTests.hs

spec :: Spec
spec = describe "Info tests" $

spec_info = describe "Info tests" $
describe "getInfo" $
it "should make a request to jenkins" $
1 `shouldBe` 1
3 changes: 1 addition & 2 deletions test/Bartlett/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import Bartlett.Types
import Network.Wreq hiding (statusCode, statusMessage)
import Test.Hspec

spec :: Spec
spec =
spec_types =
describe "Type tests" $ do

describe "getBasicAuth for BasicAuthUser" $
Expand Down
3 changes: 1 addition & 2 deletions test/Bartlett/UtilSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ jenkins withSSL =
then "https://example.com"
else "http://example.com"

spec :: Spec
spec =
spec_util =
describe "Util tests" $ do

describe "mkUrl" $ do
Expand Down
2 changes: 0 additions & 2 deletions test/Spec.hs

This file was deleted.

5 changes: 5 additions & 0 deletions test/Tasty.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{-#
OPTIONS_GHC -F
-pgmF tasty-discover
-optF --tree-display
#-}

0 comments on commit b4b5fd1

Please sign in to comment.