[arch-commits] Commit in postgrest/repos (3 files)

Felix Yan felixonmars at archlinux.org
Thu Apr 2 14:23:08 UTC 2020


    Date: Thursday, April 2, 2020 @ 14:23:08
  Author: felixonmars
Revision: 609584

archrelease: copy trunk to community-staging-x86_64

Added:
  postgrest/repos/community-staging-x86_64/
  postgrest/repos/community-staging-x86_64/PKGBUILD
    (from rev 609583, postgrest/trunk/PKGBUILD)
  postgrest/repos/community-staging-x86_64/postgrest-hspec-wai-0.10.patch
    (from rev 609583, postgrest/trunk/postgrest-hspec-wai-0.10.patch)

--------------------------------+
 PKGBUILD                       |   83 +++++
 postgrest-hspec-wai-0.10.patch |  568 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 651 insertions(+)

Copied: postgrest/repos/community-staging-x86_64/PKGBUILD (from rev 609583, postgrest/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2020-04-02 14:23:08 UTC (rev 609584)
@@ -0,0 +1,83 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+pkgname=postgrest
+pkgver=6.0.2
+pkgrel=115
+pkgdesc="REST API for any Postgres database"
+url="https://github.com/begriffs/postgrest"
+license=("MIT")
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-http' 'haskell-ranged-sets' 'haskell-aeson' 'haskell-ansi-wl-pprint'
+         'haskell-base64-bytestring' 'haskell-case-insensitive' 'haskell-cassava'
+         'haskell-configurator-pg' 'haskell-contravariant' 'haskell-contravariant-extras'
+         'haskell-cookie' 'haskell-either' 'haskell-gitrev' 'haskell-hasql' 'haskell-hasql-pool'
+         'haskell-hasql-transaction' 'haskell-heredoc' 'haskell-http-types'
+         'haskell-insert-ordered-containers' 'haskell-interpolatedstring-perl6' 'haskell-jose'
+         'haskell-lens' 'haskell-lens-aeson' 'haskell-network-uri' 'haskell-optparse-applicative'
+         'haskell-parsec' 'haskell-protolude' 'haskell-regex-tdfa' 'haskell-scientific'
+         'haskell-swagger2' 'haskell-unordered-containers' 'haskell-vector' 'haskell-wai'
+         'haskell-wai-cors' 'haskell-wai-extra' 'haskell-wai-middleware-static'
+         'haskell-auto-update' 'haskell-retry' 'haskell-warp')
+makedepends=('ghc' 'haskell-aeson-qq' 'haskell-async' 'haskell-hspec' 'haskell-hspec-wai'
+             'haskell-hspec-wai-json' 'haskell-monad-control' 'haskell-transformers-base')
+checkdepends=('pifpaf' 'postgresql' 'procps-ng')
+source=("$pkgname-$pkgver.tar.bz2::https://github.com/begriffs/postgrest/archive/v$pkgver.tar.gz"
+        postgrest-swagger-2.4.patch::https://github.com/PostgREST/postgrest/pull/1326.patch
+        postgrest-hspec-wai-0.10.patch
+        postgrest-configuration-pg-0.2.patch::https://github.com/PostgREST/postgrest/pull/1457.patch)
+sha512sums=('abdcec3291c2216cb7383e13c80cb36c7bbecaded95ebebdc4482e44418d11abafab591ed1e5568ac38cdfc8e3f8b2c6c1c2a0e3e846ee6f97ab48b42c4c580d'
+            'd8c654e55e424c8ad29c2791362109af6d0ae94a04d8726946f95caa1bd6b11d9a818069df61e03591e02b54ff15b86e4097375343e28f9354f7fafa5efdcee1'
+            '22da00f9fbdfc70b6db76d3cbf7f2406091131868077b439c35925b5fc7b56dcf218b13e2dca4c37b81e4bbba686040b2ad04086201c60885589c61bdd5df088'
+            'c391a2ff289469115c7fd932753bedc8a1f7ba283e3ca21ffaea64c25eb1678adc1519ad75e8353556444c201d06b815f57e768d12dec2e0b1770d13baaeb4d6')
+
+prepare() {
+    cd $pkgname-$pkgver
+    patch -p1 -i ../postgrest-swagger-2.4.patch
+    patch -p1 -i ../postgrest-hspec-wai-0.10.patch
+    patch -p1 -i ../postgrest-configuration-pg-0.2.patch || :
+    sed -i -e 's/< *4/<5/' -e 's/< *1/<2/' -e 's/< *3.3/<4/' -e 's/< *0/<1/' -e 's/< *2.9/<3.2/' -e 's/< *2.5/<3/' $pkgname.cabal
+
+    sed -i -e '/ fail /d' src/PostgREST/Config.hs
+
+    sed -i 's/5432/9824/' test/fixtures/dumpfixture.sh
+}
+
+build() {
+    cd "${srcdir}/${pkgname}-${pkgver}"
+
+    runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+        --prefix=/usr --docdir="/usr/share/doc/${pkgname}" --enable-tests \
+        --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \
+            -f-CI --ghc-option='-pie'
+    runhaskell Setup build
+    runhaskell Setup register --gen-script
+    runhaskell Setup unregister --gen-script
+    sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
+    sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
+}
+
+check() {
+    cd $pkgname-$pkgver
+
+    eval $(pifpaf run postgresql --host 127.0.0.1)
+    createdb postgrest_test
+
+    # TODO: user authentication issue?
+    POSTGREST_TEST_CONNECTION=$(test/create_test_db "postgres://$USER@localhost" postgrest_test) runhaskell Setup test || warning "Tests failed"
+
+    # Disabled: uses stack
+    # test/io-tests.sh
+
+    pifpaf_stop
+}
+
+package() {
+    cd "${srcdir}/${pkgname}-${pkgver}"
+
+    install -D -m744 register.sh   "${pkgdir}/usr/share/haskell/register/${pkgname}.sh"
+    install -D -m744 unregister.sh "${pkgdir}/usr/share/haskell/unregister/${pkgname}.sh"
+    runhaskell Setup copy --destdir="${pkgdir}"
+    install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+    rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
+}

Copied: postgrest/repos/community-staging-x86_64/postgrest-hspec-wai-0.10.patch (from rev 609583, postgrest/trunk/postgrest-hspec-wai-0.10.patch)
===================================================================
--- community-staging-x86_64/postgrest-hspec-wai-0.10.patch	                        (rev 0)
+++ community-staging-x86_64/postgrest-hspec-wai-0.10.patch	2020-04-02 14:23:08 UTC (rev 609584)
@@ -0,0 +1,568 @@
+From 228782ed982b61c26893e4af99a8c34487fd08f6 Mon Sep 17 00:00:00 2001
+From: Robert Vollmert <rob at vllmrt.net>
+Date: Sat, 7 Mar 2020 12:28:26 +0100
+Subject: [PATCH 1/3] Update stack.yaml.lock for HSYaml extra-deps.
+
+---
+ stack.yaml.lock | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/stack.yaml.lock b/stack.yaml.lock
+index 008e8126..d08997c3 100644
+--- a/stack.yaml.lock
++++ b/stack.yaml.lock
+@@ -3,7 +3,21 @@
+ # For more information, please see the documentation at:
+ #   https://docs.haskellstack.org/en/stable/lock_files
+
+-packages: []
++packages:
++- completed:
++    hackage: HsYAML-0.2.1.0 at sha256:e4677daeba57f7a1e9a709a1f3022fe937336c91513e893166bd1f023f530d68,5311
++    pantry-tree:
++      size: 1340
++      sha256: 21f61bf9cad31674126b106071dd9b852e408796aeffc90eec1792f784107eff
++  original:
++    hackage: HsYAML-0.2.1.0 at sha256:e4677daeba57f7a1e9a709a1f3022fe937336c91513e893166bd1f023f530d68,5311
++- completed:
++    hackage: HsYAML-aeson-0.2.0.0 at sha256:04796abfc01cffded83f37a10e6edba4f0c0a15d45bef44fc5bb4313d9c87757,1791
++    pantry-tree:
++      size: 234
++      sha256: 67cc9ba17c79e71d3abdb465a3ee2825477856fff3b8b7d543cbbbefdae9a9d9
++  original:
++    hackage: HsYAML-aeson-0.2.0.0 at sha256:04796abfc01cffded83f37a10e6edba4f0c0a15d45bef44fc5bb4313d9c87757,1791
+ snapshots:
+ - completed:
+     size: 523878
+
+From a4492b6117b3c31a0e09c2988bb8de394ec77550 Mon Sep 17 00:00:00 2001
+From: Robert Vollmert <rob at vllmrt.net>
+Date: Sat, 7 Mar 2020 13:46:22 +0100
+Subject: [PATCH 2/3] Upgrade hspec-wai dependency to 0.10.
+
+---
+ postgrest.cabal                         |  8 +++----
+ stack.yaml                              |  2 ++
+ stack.yaml.lock                         | 14 ++++++++++++
+ test/Feature/AndOrParamsSpec.hs         |  2 +-
+ test/Feature/AsymmetricJwtSpec.hs       |  2 +-
+ test/Feature/AudienceJwtSecretSpec.hs   |  2 +-
+ test/Feature/AuthSpec.hs                |  2 +-
+ test/Feature/BinaryJwtSecretSpec.hs     |  2 +-
+ test/Feature/ConcurrentSpec.hs          | 10 ++++-----
+ test/Feature/CorsSpec.hs                |  2 +-
+ test/Feature/DeleteSpec.hs              |  2 +-
+ test/Feature/EmbedDisambiguationSpec.hs |  2 +-
+ test/Feature/ExtraSearchPathSpec.hs     |  2 +-
+ test/Feature/HtmlRawOutputSpec.hs       |  2 +-
+ test/Feature/InsertSpec.hs              |  2 +-
+ test/Feature/JsonOperatorSpec.hs        |  2 +-
+ test/Feature/NoJwtSpec.hs               |  2 +-
+ test/Feature/NonexistentSchemaSpec.hs   |  2 +-
+ test/Feature/PgVersion95Spec.hs         |  2 +-
+ test/Feature/PgVersion96Spec.hs         |  2 +-
+ test/Feature/ProxySpec.hs               |  2 +-
+ test/Feature/QueryLimitedSpec.hs        |  2 +-
+ test/Feature/QuerySpec.hs               |  2 +-
+ test/Feature/RangeSpec.hs               |  2 +-
+ test/Feature/RawOutputTypesSpec.hs      |  2 +-
+ test/Feature/RootSpec.hs                |  2 +-
+ test/Feature/RpcSpec.hs                 |  2 +-
+ test/Feature/SingularSpec.hs            |  2 +-
+ test/Feature/StructureSpec.hs           |  2 +-
+ test/Feature/UnicodeSpec.hs             |  2 +-
+ test/Feature/UpsertSpec.hs              |  2 +-
+ test/Main.hs                            | 30 +++++++++++++------------
+ test/SpecHelper.hs                      |  2 +-
+ 33 files changed, 69 insertions(+), 51 deletions(-)
+
+diff --git a/postgrest.cabal b/postgrest.cabal
+index 46ea4c59..0538a6bb 100644
+--- a/postgrest.cabal
++++ b/postgrest.cabal
+@@ -167,8 +167,8 @@ test-suite spec
+                     , hasql-transaction >= 0.7.2 && < 0.8
+                     , heredoc           >= 0.2 && < 0.3
+                     , hspec             >= 2.3 && < 2.8
+-                    , hspec-wai         >= 0.7 && < 0.10
+-                    , hspec-wai-json    >= 0.7 && < 0.10
++                    , hspec-wai         >= 0.10 && < 0.11
++                    , hspec-wai-json    >= 0.10 && < 0.11
+                     , http-types        >= 0.12.3 && < 0.13
+                     , lens              >= 4.14 && < 4.18
+                     , lens-aeson        >= 1.0.1 && < 1.1
+diff --git a/stack.yaml.lock b/stack.yaml.lock
+index d08997c3..02719eb3 100644
+--- a/stack.yaml.lock
++++ b/stack.yaml.lock
+@@ -18,6 +18,20 @@ packages:
+       sha256: 67cc9ba17c79e71d3abdb465a3ee2825477856fff3b8b7d543cbbbefdae9a9d9
+   original:
+     hackage: HsYAML-aeson-0.2.0.0 at sha256:04796abfc01cffded83f37a10e6edba4f0c0a15d45bef44fc5bb4313d9c87757,1791
++- completed:
++    hackage: hspec-wai-0.10.1 at sha256:56dd9ec1d56f47ef1946f71f7cbf070e4c285f718cac1b158400ae5e7172ef47,2290
++    pantry-tree:
++      size: 809
++      sha256: 17af1c2e709cd84bfda066b9ebb04cdde7f92660c51a1f7401a1e9f766524e93
++  original:
++    hackage: hspec-wai-0.10.1 at sha256:56dd9ec1d56f47ef1946f71f7cbf070e4c285f718cac1b158400ae5e7172ef47,2290
++- completed:
++    hackage: hspec-wai-json-0.10.1 at sha256:67b405c38f0a9e2771480c8d3ecd8aeb8d8776a35d3b2906cb1b76c9538617e4,1629
++    pantry-tree:
++      size: 349
++      sha256: fb9e89b79cde3276baa484c860c6b9eeebdbc1a5c43301293351a25bc4c08e87
++  original:
++    hackage: hspec-wai-json-0.10.1 at sha256:67b405c38f0a9e2771480c8d3ecd8aeb8d8776a35d3b2906cb1b76c9538617e4,1629
+ snapshots:
+ - completed:
+     size: 523878
+diff --git a/test/Feature/AndOrParamsSpec.hs b/test/Feature/AndOrParamsSpec.hs
+index 9193b91b..f315f1a0 100644
+--- a/test/Feature/AndOrParamsSpec.hs
++++ b/test/Feature/AndOrParamsSpec.hs
+@@ -11,7 +11,7 @@ import PostgREST.Types (PgVersion, pgVersion112)
+ import Protolude       hiding (get)
+ import SpecHelper
+
+-spec :: PgVersion -> SpecWith Application
++spec :: PgVersion -> SpecWith ((), Application)
+ spec actualPgVersion =
+   describe "and/or params used for complex boolean logic" $ do
+     context "used with GET" $ do
+diff --git a/test/Feature/AsymmetricJwtSpec.hs b/test/Feature/AsymmetricJwtSpec.hs
+index 780220a2..c2c46b23 100644
+--- a/test/Feature/AsymmetricJwtSpec.hs
++++ b/test/Feature/AsymmetricJwtSpec.hs
+@@ -11,7 +11,7 @@ import Protolude
+ import SpecHelper
+ -- }}}
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec = describe "server started with asymmetric JWK" $
+
+   -- this test will stop working 9999999999s after the UNIX EPOCH
+diff --git a/test/Feature/AudienceJwtSecretSpec.hs b/test/Feature/AudienceJwtSecretSpec.hs
+index 6cd5912b..e5a91ff3 100644
+--- a/test/Feature/AudienceJwtSecretSpec.hs
++++ b/test/Feature/AudienceJwtSecretSpec.hs
+@@ -11,7 +11,7 @@ import Protolude  hiding (get)
+ import SpecHelper
+ -- }}}
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec = describe "test handling of aud claims in JWT" $ do
+
+   -- this test will stop working 9999999999s after the UNIX EPOCH
+diff --git a/test/Feature/AuthSpec.hs b/test/Feature/AuthSpec.hs
+index f8e964df..10901886 100644
+--- a/test/Feature/AuthSpec.hs
++++ b/test/Feature/AuthSpec.hs
+@@ -12,7 +12,7 @@ import PostgREST.Types (PgVersion, pgVersion112)
+ import Protolude       hiding (get)
+ import SpecHelper
+
+-spec :: PgVersion -> SpecWith Application
++spec :: PgVersion -> SpecWith ((), Application)
+ spec actualPgVersion = describe "authorization" $ do
+   let single = ("Accept","application/vnd.pgrst.object+json")
+
+diff --git a/test/Feature/BinaryJwtSecretSpec.hs b/test/Feature/BinaryJwtSecretSpec.hs
+index 6229aad9..599f7e2f 100644
+--- a/test/Feature/BinaryJwtSecretSpec.hs
++++ b/test/Feature/BinaryJwtSecretSpec.hs
+@@ -11,7 +11,7 @@ import Protolude
+ import SpecHelper
+ -- }}}
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec = describe "server started with binary JWT secret" $
+
+   -- this test will stop working 9999999999s after the UNIX EPOCH
+diff --git a/test/Feature/ConcurrentSpec.hs b/test/Feature/ConcurrentSpec.hs
+index ffbb79ed..cab23aec 100644
+--- a/test/Feature/ConcurrentSpec.hs
++++ b/test/Feature/ConcurrentSpec.hs
+@@ -19,7 +19,7 @@ import Test.Hspec.Wai.JSON
+
+ import Protolude hiding (get)
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "Queryiny in parallel" $
+     it "should not raise 'transaction in progress' error" $
+@@ -35,13 +35,13 @@ spec =
+           , matchHeaders = []
+           }
+
+-raceTest :: Int -> WaiExpectation -> WaiExpectation
++raceTest :: Int -> WaiExpectation st -> WaiExpectation st
+ raceTest times = liftBaseDiscard go
+  where
+   go test = void $ mapConcurrently (const test) [1..times]
+
+-instance MonadBaseControl IO WaiSession where
+-  type StM WaiSession a = StM Session a
++instance MonadBaseControl IO (WaiSession st) where
++  type StM (WaiSession st) a = StM Session a
+   liftBaseWith f = WaiSession $
+     liftBaseWith $ \runInBase ->
+       f $ \k -> runInBase (unWaiSession k)
+@@ -49,5 +49,5 @@ instance MonadBaseControl IO WaiSession where
+   {-# INLINE liftBaseWith #-}
+   {-# INLINE restoreM #-}
+
+-instance MonadBase IO WaiSession where
++instance MonadBase IO (WaiSession st) where
+   liftBase = liftIO
+diff --git a/test/Feature/CorsSpec.hs b/test/Feature/CorsSpec.hs
+index 6115c33e..cdadef63 100644
+--- a/test/Feature/CorsSpec.hs
++++ b/test/Feature/CorsSpec.hs
+@@ -14,7 +14,7 @@ import Protolude
+ import SpecHelper
+ -- }}}
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "CORS" $ do
+     let preflightHeaders = [
+diff --git a/test/Feature/DeleteSpec.hs b/test/Feature/DeleteSpec.hs
+index de549f2d..0acc5244 100644
+--- a/test/Feature/DeleteSpec.hs
++++ b/test/Feature/DeleteSpec.hs
+@@ -10,7 +10,7 @@ import Text.Heredoc
+
+ import Protolude hiding (get)
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "Deleting" $ do
+     context "existing record" $ do
+diff --git a/test/Feature/ExtraSearchPathSpec.hs b/test/Feature/ExtraSearchPathSpec.hs
+index c1c2e112..6df40bf2 100644
+--- a/test/Feature/ExtraSearchPathSpec.hs
++++ b/test/Feature/ExtraSearchPathSpec.hs
+@@ -9,7 +9,7 @@ import Test.Hspec.Wai.JSON
+ import Protolude
+ import SpecHelper
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec = describe "extra search path" $ do
+
+   it "finds the ltree <@ operator on the public schema" $
+diff --git a/test/Feature/HtmlRawOutputSpec.hs b/test/Feature/HtmlRawOutputSpec.hs
+index 490b7b38..ace649e1 100644
+--- a/test/Feature/HtmlRawOutputSpec.hs
++++ b/test/Feature/HtmlRawOutputSpec.hs
+@@ -10,7 +10,7 @@ import Text.Heredoc
+ import Protolude  hiding (get)
+ import SpecHelper (acceptHdrs)
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec = describe "When raw-media-types is set to \"text/html\"" $
+   it "can get raw output with Accept: text/html" $
+     request methodGet "/rpc/welcome.html" (acceptHdrs "text/html") ""
+diff --git a/test/Feature/InsertSpec.hs b/test/Feature/InsertSpec.hs
+index ca99620d..ce0fe4aa 100644
+--- a/test/Feature/InsertSpec.hs
++++ b/test/Feature/InsertSpec.hs
+@@ -20,7 +20,7 @@ import PostgREST.Types (PgVersion, pgVersion112)
+ import Protolude       hiding (get)
+ import SpecHelper
+
+-spec :: PgVersion -> SpecWith Application
++spec :: PgVersion -> SpecWith ((), Application)
+ spec actualPgVersion = do
+   describe "Posting new record" $ do
+     context "disparate json types" $ do
+diff --git a/test/Feature/JsonOperatorSpec.hs b/test/Feature/JsonOperatorSpec.hs
+index 1f3b4166..7367bcda 100644
+--- a/test/Feature/JsonOperatorSpec.hs
++++ b/test/Feature/JsonOperatorSpec.hs
+@@ -11,7 +11,7 @@ import PostgREST.Types (PgVersion, pgVersion112)
+ import Protolude       hiding (get)
+ import SpecHelper
+
+-spec :: PgVersion -> SpecWith Application
++spec :: PgVersion -> SpecWith ((), Application)
+ spec actualPgVersion = describe "json and jsonb operators" $ do
+   context "Shaping response with select parameter" $ do
+     it "obtains a json subfield one level with casting" $
+diff --git a/test/Feature/NoJwtSpec.hs b/test/Feature/NoJwtSpec.hs
+index 453bd8fd..4e7b6524 100644
+--- a/test/Feature/NoJwtSpec.hs
++++ b/test/Feature/NoJwtSpec.hs
+@@ -13,7 +13,7 @@ import Protolude
+ import SpecHelper
+ -- }}}
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec = describe "server started without JWT secret" $ do
+
+   -- this test will stop working 9999999999s after the UNIX EPOCH
+diff --git a/test/Feature/NonexistentSchemaSpec.hs b/test/Feature/NonexistentSchemaSpec.hs
+index ed1d5dce..7327c03c 100644
+--- a/test/Feature/NonexistentSchemaSpec.hs
++++ b/test/Feature/NonexistentSchemaSpec.hs
+@@ -7,7 +7,7 @@ import Test.Hspec.Wai
+
+ import Protolude hiding (get)
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "Non existent api schema" $ do
+     it "succeeds when requesting root path" $
+diff --git a/test/Feature/PgVersion95Spec.hs b/test/Feature/PgVersion95Spec.hs
+index dc5cedc6..31f88923 100644
+--- a/test/Feature/PgVersion95Spec.hs
++++ b/test/Feature/PgVersion95Spec.hs
+@@ -9,7 +9,7 @@ import Test.Hspec.Wai.JSON
+ import Protolude  hiding (get)
+ import SpecHelper
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec = describe "features supported on PostgreSQL 9.5" $
+   context "json array negative index" $ do
+     it "can select with negative indexes" $ do
+diff --git a/test/Feature/PgVersion96Spec.hs b/test/Feature/PgVersion96Spec.hs
+index e6a0cf59..58426e3e 100644
+--- a/test/Feature/PgVersion96Spec.hs
++++ b/test/Feature/PgVersion96Spec.hs
+@@ -10,7 +10,7 @@ import Test.Hspec.Wai.JSON
+ import Protolude  hiding (get)
+ import SpecHelper
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "features supported on PostgreSQL 9.6" $ do
+     context "GUC headers on function calls" $ do
+diff --git a/test/Feature/ProxySpec.hs b/test/Feature/ProxySpec.hs
+index 2077c71a..7f3a0966 100644
+--- a/test/Feature/ProxySpec.hs
++++ b/test/Feature/ProxySpec.hs
+@@ -6,7 +6,7 @@ import Test.Hspec  hiding (pendingWith)
+ import Protolude
+ import SpecHelper
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "GET / with proxy" $
+     it "returns a valid openapi spec with proxy" $
+diff --git a/test/Feature/QueryLimitedSpec.hs b/test/Feature/QueryLimitedSpec.hs
+index e5d2c9f0..79a57e39 100644
+--- a/test/Feature/QueryLimitedSpec.hs
++++ b/test/Feature/QueryLimitedSpec.hs
+@@ -11,7 +11,7 @@ import Test.Hspec.Wai.JSON
+ import Protolude  hiding (get)
+ import SpecHelper
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "Requesting many items with server limits(max-rows) enabled" $ do
+     it "restricts results" $
+diff --git a/test/Feature/QuerySpec.hs b/test/Feature/QuerySpec.hs
+index a5c7ba23..fec9b74b 100644
+--- a/test/Feature/QuerySpec.hs
++++ b/test/Feature/QuerySpec.hs
+@@ -14,7 +14,7 @@ import PostgREST.Types (PgVersion, pgVersion112)
+ import Protolude       hiding (get)
+ import SpecHelper
+
+-spec :: PgVersion -> SpecWith Application
++spec :: PgVersion -> SpecWith ((), Application)
+ spec actualPgVersion = do
+
+   describe "Querying a table with a column called count" $
+diff --git a/test/Feature/RangeSpec.hs b/test/Feature/RangeSpec.hs
+index 74b30ffe..c7e2df1f 100644
+--- a/test/Feature/RangeSpec.hs
++++ b/test/Feature/RangeSpec.hs
+@@ -19,7 +19,7 @@ defaultRange = [json| { "min": 0, "max": 15 } |]
+ emptyRange :: BL.ByteString
+ emptyRange = [json| { "min": 2, "max": 2 } |]
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec = do
+   describe "POST /rpc/getitemrange" $ do
+     context "without range headers" $ do
+diff --git a/test/Feature/RawOutputTypesSpec.hs b/test/Feature/RawOutputTypesSpec.hs
+index dd99e0ad..6975ce63 100644
+--- a/test/Feature/RawOutputTypesSpec.hs
++++ b/test/Feature/RawOutputTypesSpec.hs
+@@ -10,7 +10,7 @@ import Test.Hspec.Wai.JSON
+ import Protolude
+ import SpecHelper (acceptHdrs)
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec = describe "When raw-media-types config variable is missing or left empty" $ do
+   let firefoxAcceptHdrs = acceptHdrs "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
+       chromeAcceptHdrs = acceptHdrs "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3"
+diff --git a/test/Feature/RootSpec.hs b/test/Feature/RootSpec.hs
+index 74fa89fb..92721663 100644
+--- a/test/Feature/RootSpec.hs
++++ b/test/Feature/RootSpec.hs
+@@ -11,7 +11,7 @@ import Protolude hiding (get)
+
+ import SpecHelper
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "root spec function" $ do
+     it "accepts application/openapi+json" $
+diff --git a/test/Feature/RpcSpec.hs b/test/Feature/RpcSpec.hs
+index 0fdb5aec..ede88072 100644
+--- a/test/Feature/RpcSpec.hs
++++ b/test/Feature/RpcSpec.hs
+@@ -17,7 +17,7 @@ import PostgREST.Types (PgVersion, pgVersion100, pgVersion109,
+ import Protolude       hiding (get)
+ import SpecHelper
+
+-spec :: PgVersion -> SpecWith Application
++spec :: PgVersion -> SpecWith ((), Application)
+ spec actualPgVersion =
+   describe "remote procedure call" $ do
+     context "a proc that returns a set" $ do
+diff --git a/test/Feature/SingularSpec.hs b/test/Feature/SingularSpec.hs
+index 28d5de15..b1c0d03a 100644
+--- a/test/Feature/SingularSpec.hs
++++ b/test/Feature/SingularSpec.hs
+@@ -13,7 +13,7 @@ import Protolude  hiding (get)
+ import SpecHelper
+
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "Requesting singular json object" $ do
+     let pgrstObj = "application/vnd.pgrst.object+json"
+diff --git a/test/Feature/StructureSpec.hs b/test/Feature/StructureSpec.hs
+index 3825aaba..02ce083b 100644
+--- a/test/Feature/StructureSpec.hs
++++ b/test/Feature/StructureSpec.hs
+@@ -17,7 +17,7 @@ import PostgREST.Config (docsVersion)
+ import Protolude        hiding (get)
+ import SpecHelper
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec = do
+
+   describe "OpenAPI" $ do
+diff --git a/test/Feature/UnicodeSpec.hs b/test/Feature/UnicodeSpec.hs
+index 7111b20a..a3e9ce68 100644
+--- a/test/Feature/UnicodeSpec.hs
++++ b/test/Feature/UnicodeSpec.hs
+@@ -10,7 +10,7 @@ import Test.Hspec.Wai.JSON
+ import Protolude  hiding (get)
+ import SpecHelper
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "Reading and writing to unicode schema and table names" $
+     it "Can read and write values" $ do
+diff --git a/test/Feature/UpsertSpec.hs b/test/Feature/UpsertSpec.hs
+index b5d2c5f6..9c81a311 100644
+--- a/test/Feature/UpsertSpec.hs
++++ b/test/Feature/UpsertSpec.hs
+@@ -11,7 +11,7 @@ import Text.Heredoc
+ import Protolude  hiding (get, put)
+ import SpecHelper
+
+-spec :: SpecWith Application
++spec :: SpecWith ((), Application)
+ spec =
+   describe "UPSERT" $ do
+     context "with POST" $ do
+diff --git a/test/Main.hs b/test/Main.hs
+index 7ecec37c..84cf717e 100644
+--- a/test/Main.hs
++++ b/test/Main.hs
+@@ -65,19 +65,21 @@ main = do
+
+   refDbStructure <- newIORef $ Just dbStructure
+
+-  let withApp              = return $ postgrest (testCfg testDbConn)                  refDbStructure pool getTime $ pure ()
+-      ltdApp               = return $ postgrest (testLtdRowsCfg testDbConn)           refDbStructure pool getTime $ pure ()
+-      unicodeApp           = return $ postgrest (testUnicodeCfg testDbConn)           refDbStructure pool getTime $ pure ()
+-      proxyApp             = return $ postgrest (testProxyCfg testDbConn)             refDbStructure pool getTime $ pure ()
+-      noJwtApp             = return $ postgrest (testCfgNoJWT testDbConn)             refDbStructure pool getTime $ pure ()
+-      binaryJwtApp         = return $ postgrest (testCfgBinaryJWT testDbConn)         refDbStructure pool getTime $ pure ()
+-      audJwtApp            = return $ postgrest (testCfgAudienceJWT testDbConn)       refDbStructure pool getTime $ pure ()
+-      asymJwkApp           = return $ postgrest (testCfgAsymJWK testDbConn)           refDbStructure pool getTime $ pure ()
+-      asymJwkSetApp        = return $ postgrest (testCfgAsymJWKSet testDbConn)        refDbStructure pool getTime $ pure ()
+-      nonexistentSchemaApp = return $ postgrest (testNonexistentSchemaCfg testDbConn) refDbStructure pool getTime $ pure ()
+-      extraSearchPathApp   = return $ postgrest (testCfgExtraSearchPath testDbConn)   refDbStructure pool getTime $ pure ()
+-      rootSpecApp          = return $ postgrest (testCfgRootSpec testDbConn)          refDbStructure pool getTime $ pure ()
+-      htmlRawOutputApp     = return $ postgrest (testCfgHtmlRawOutput testDbConn)     refDbStructure pool getTime $ pure ()
++  let app cfg = return ((), postgrest (cfg testDbConn) refDbStructure pool getTime $ pure ())
++
++  let withApp              = app testCfg
++      ltdApp               = app testLtdRowsCfg
++      unicodeApp           = app testUnicodeCfg
++      proxyApp             = app testProxyCfg
++      noJwtApp             = app testCfgNoJWT
++      binaryJwtApp         = app testCfgBinaryJWT
++      audJwtApp            = app testCfgAudienceJWT
++      asymJwkApp           = app testCfgAsymJWK
++      asymJwkSetApp        = app testCfgAsymJWKSet
++      nonexistentSchemaApp = app testNonexistentSchemaCfg
++      extraSearchPathApp   = app testCfgExtraSearchPath
++      rootSpecApp          = app testCfgRootSpec
++      htmlRawOutputApp     = app testCfgHtmlRawOutput
+
+   let reset, analyze :: IO ()
+       reset = resetDb testDbConn
+diff --git a/test/SpecHelper.hs b/test/SpecHelper.hs
+index b577e285..ab1d8519 100644
+--- a/test/SpecHelper.hs
++++ b/test/SpecHelper.hs
+@@ -32,7 +32,7 @@ matchContentTypeJson = "Content-Type" <:> "application/json; charset=utf-8"
+ matchContentTypeSingular :: MatchHeader
+ matchContentTypeSingular = "Content-Type" <:> "application/vnd.pgrst.object+json; charset=utf-8"
+
+-validateOpenApiResponse :: [Header] -> WaiSession ()
++validateOpenApiResponse :: [Header] -> WaiSession () ()
+ validateOpenApiResponse headers = do
+   r <- request methodGet "/" headers ""
+   liftIO $
+
+From 6094074ca9571fbfdd4cb0c2f443f586d8bd3617 Mon Sep 17 00:00:00 2001
+From: Robert Vollmert <rob at vllmrt.net>
+Date: Sat, 7 Mar 2020 14:35:32 +0100
+Subject: [PATCH 3/3] Fix test typo.
+
+---
+ test/Feature/ConcurrentSpec.hs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/Feature/ConcurrentSpec.hs b/test/Feature/ConcurrentSpec.hs
+index cab23aec..eab6d69d 100644
+--- a/test/Feature/ConcurrentSpec.hs
++++ b/test/Feature/ConcurrentSpec.hs
+@@ -21,7 +21,7 @@ import Protolude hiding (get)
+
+ spec :: SpecWith ((), Application)
+ spec =
+-  describe "Queryiny in parallel" $
++  describe "Querying in parallel" $
+     it "should not raise 'transaction in progress' error" $
+       raceTest 10 $
+         get "/fakefake"



More information about the arch-commits mailing list