gargoyle-postgresql 0.2.0.0 → 0.2.0.1
raw patch · 3 files changed
+28/−13 lines, 3 filesdep ~gargoyle
Dependency ranges changed: gargoyle
Files
- ChangeLog.md +4/−1
- gargoyle-postgresql.cabal +4/−4
- tests/gargoyle-psql-test.hs +20/−8
ChangeLog.md view
@@ -1,11 +1,14 @@ # Changelog for gargoyle-postgresql+ +## 0.2.0.1 +* Disable test suite+ ## 0.2 * Bugfix: Replace use of file handle with /dev/null to fix a crash due to lack of referential transparency in GHCs behavior with respect to file Handles * Loosen version bounds * Add `gargoyle-pg-run`, which makes it easier to run gargoyle-database-using programs (e.g., psql, pg_dump).-* Enable test suite by default ## 0.1
gargoyle-postgresql.cabal view
@@ -1,5 +1,5 @@ name: gargoyle-postgresql-version: 0.2.0.0+version: 0.2.0.1 license: BSD3 license-file: LICENSE author: Obsidian Systems LLC@@ -36,7 +36,7 @@ tested-with: GHC ==8.6.5 || ==8.8.4 || ==8.10.2 -- Requires postgres to be in the environment to run-flag disable-psql-test+flag enable-psql-test default: False manual: True @@ -48,7 +48,7 @@ base >=4.12 && <4.15 , bytestring >=0.10 && <0.12 , directory >=1.3 && <1.4- , gargoyle ==0.1.1+ , gargoyle >=0.1.1.0 && < 0.2 , posix-escape >=0.1 && <0.2 , process >=1.5 && <1.7 , stringsearch >=0.3 && <0.4@@ -106,7 +106,7 @@ hs-source-dirs: tests default-language: Haskell2010 - if flag(disable-psql-test)+ if !flag(enable-psql-test) buildable: False else
tests/gargoyle-psql-test.hs view
@@ -4,17 +4,29 @@ import System.Exit import System.FilePath import System.Posix.Temp+import System.Process import Gargoyle import Gargoyle.PostgreSQL main :: IO () main = do- let testPostgres = defaultPostgres- { _gargoyle_exec = "dist/build" </> "gargoyle-postgres-monitor/gargoyle-postgres-monitor"- }- --TODO make this exception safe- testPath <- mkdtemp "psql-test"- psqlLocal testPostgres "psql" (testPath </> "db") (Just "")- removeDirectoryRecursive testPath- exitSuccess+ (exitCode, paths, _) <- readProcessWithExitCode "find"+ [ "."+ , "-executable"+ , "-type", "f"+ , "-iname", "gargoyle-postgres-monitor"+ ] ""+ case exitCode of+ ExitSuccess -> case lines paths of+ (path:_) -> do+ let testPostgres = defaultPostgres+ { _gargoyle_exec = path+ }+ --TODO make this exception safe+ testPath <- mkdtemp "psql-test"+ psqlLocal testPostgres "psql" (testPath </> "db") (Just "")+ removeDirectoryRecursive testPath+ exitSuccess+ _ -> error "Could not find gargoyle-postgres-monitor"+