packages feed

marvin 0.2.1 → 0.2.2

raw patch · 3 files changed

+5/−118 lines, 3 filesdep −extradep −lens-aesondep −processdep ~lensdep ~marvindep ~textPVP ok

version bump matches the API change (PVP)

Dependencies removed: extra, lens-aeson, process, temporary, yaml

Dependency ranges changed: lens, marvin, text

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.2.2 - 05.03.2017++- Removed the integration tests from the cabal package config+ # 0.2.1 - 04.03.2017  - Fixed the templates for the initializer
marvin.cabal view
@@ -1,5 +1,5 @@ name:                marvin-version:             0.2.1+version:             0.2.2 synopsis:            A framework for modular, portable chat bots. description:         A framework for writing portable chat bots. Inspired by hubot.                       . @@ -141,31 +141,6 @@   build-depends:       base >= 4.7 && < 5                      , marvin                      , hspec >= 2.2-  ghc-options:         -threaded -rtsopts -with-rtsopts=-N-  default-language:    Haskell2010-  default-extensions:  OverloadedStrings-                     , TypeFamilies-                     , MultiParamTypeClasses-                     , TupleSections-                     , GADTs--test-suite marvin-integration-tests-  type:                exitcode-stdio-1.0-  hs-source-dirs:      test-  main-is:             IntegrationSpec.hs-  build-depends:       base >= 4.7 && < 5-                     , marvin-                     , hspec >= 2.2-                     , temporary >= 1.2-                     , process >= 1.2-                     , filepath >= 1.4-                     , directory >= 1.2-                     , monad-loops >= 0.4-                     , extra >= 1.4-                     , yaml-                     , lens-aeson-                     , lens-                     , text   ghc-options:         -threaded -rtsopts -with-rtsopts=-N   default-language:    Haskell2010   default-extensions:  OverloadedStrings
− test/IntegrationSpec.hs
@@ -1,92 +0,0 @@-import           Control.Lens-import           Control.Monad.Extra-import           Data.Aeson.Lens-import           Data.Maybe-import           Data.Text           (Text)-import           Data.Yaml-import           System.Directory-import           System.Environment-import           System.FilePath-import           System.Info.Extra-import           System.IO.Temp-import           System.Process-import           Test.Hspec--stackBuildArgs :: [String]-stackBuildArgs-    | isMac = ["--extra-lib-dirs=/usr/local/opt/icu4c/lib", "--extra-include-dirs=/usr/local/opt/icu4c/include"]-    | otherwise = []--copyDirectory :: FilePath -> FilePath -> IO ()-copyDirectory source target = do-    createDirectoryIfMissing True target-    (dirs, files) <- getDirectoryContents source >>=-        partitionM (doesDirectoryExist . (source </>))-        . filter (\a -> not $ a == "." || a == "..")-    mapM_ (copyFile <$> (source </>) <*> (target </>)) files-    mapM_ (copyDirectory <$> (source </>) <*> (target </>)) dirs----- | In the .travis.yml file I pass the stack yaml as STACK_YAML env variable.--- This is necessary as the extra-deps are different for some lts versions--- However the yaml file in STACK_YAML cannot be used by the integration tests,--- as they require both marvins source directory as well as their own to be--- recorded in the `packages` key.--- This function reads the stack.yaml, modifies the `packages` section and--- writes a new stack.yaml to the target path which the tests pass to stack via--- then `--stack-yaml` command line parameter-getAndModifyStackYaml :: FilePath -> IO ()-getAndModifyStackYaml targetPath = do-    path <- fromMaybe "test/resources/stack.yaml" <$> lookupEnv "STACK_YAML"-    Just yamlFile <- decodeFile path-    encodeFile targetPath $ (yamlFile :: Value) & key "packages" .~ packageObject-  where-    packageObject = toJSON [".", ".." :: Text]---getResolver :: IO String-getResolver = fromMaybe "lts" <$> lookupEnv "STACK_RESOLVER"----- | This test is used to make sure the initializer produces a compileable project-runInitAndCompileResult :: IO ()-runInitAndCompileResult =-    withTempDirectory "." ".test" $ \dir -> do-        getAndModifyStackYaml (dir </> "stack.yaml")-        withCurrentDirectory dir $ do-            resolver <- getResolver-            callProcess "stack"-                [ "exec"-                , "--resolver", resolver-                , "--stack-yaml", "stack.yaml"-                , "--", "marvin-init"-                    , "-a", "shell"-                    , "testbot"]-            callProcess "stack" $-                [ "build"-                , "--stack-yaml", "stack.yaml"-                , "--resolver", resolver-                ] ++ stackBuildArgs---compileIntegration :: IO ()-compileIntegration =-    withTempDirectory "." ".test" $ \dir -> do-        resolver <- getResolver-        copyDirectory "test/integration" dir-        getAndModifyStackYaml (dir </> "stack.yaml")-        withCurrentDirectory dir $ callProcess "stack" $-            [ "build"-            , "--stack-yaml", "stack.yaml"-            , "--resolver", resolver-            ] ++ stackBuildArgs---main :: IO ()-main = hspec $ do-    describe "the integration test" $-        it "compiles the integration test suite" $-            compileIntegration `shouldReturn` ()-    describe "initializer" $-        it "produces a compileable project" $-            runInitAndCompileResult `shouldReturn` ()