on master help sign in
Use cabal-install to invoke doctest
commit222ccf107c31057441515adfd388ae182941a6e2 authorJanus Troelsen <janus@flipstone.com> dateMon 7 Mar 2022, 21:32 (5 years ago) parent7ef9730
4 files changed+14−27
.github/workflows/master.yml+12−22 cabal.project−3 servant-client/src/Servant/Client/Internal/HttpClient.hs+1−1 servant-swagger/servant-swagger.cabal+1−1
.github/workflows/master.yml+12−22
@@ -47,10 +47,7 @@ jobs:
4747
4848 - name: Configure
4949 run: |
50− # Using separate store-dir because default one already has 'ghc-paths' package installed
51− # with hardcoded path to ghcup's GHC path (which it was built with). This leads to failure in
52− # doctest, as it tries to invoke that GHC, and it doesn't exist here.
53− cabal --store-dir /tmp/cabal-store install --ignore-project -j2 doctest --constraint='doctest ^>=0.18'
50+ cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.20'
5451
5552 - name: Build
5653 run: |
@@ -68,24 +65,17 @@ jobs:
6865 # Necessary for doctest to be found in $PATH
6966 export PATH="$HOME/.cabal/bin:$PATH"
7067
71− # Filter out base-compat-batteries from .ghc.environment.*, as its modules
72− # conflict with those of base-compat.
73− #
74− # FIXME: This is an ugly hack. Ultimately, we'll want to use cabal-doctest
75− # (or cabal v2-doctest, if it ever lands) to provide a clean GHC environment.
76− # This might allow running doctests in GHCJS build as well.
77− perl -i -e 'while (<ARGV>) { print unless /package-id\s+(base-compat-batteries)-\d+(\.\d+)*/; }' .ghc.environment.*
78−
79− (cd servant && doctest src)
80− (cd servant-client && doctest src)
81− (cd servant-client-core && doctest src)
82− (cd servant-http-streams && doctest src)
83− (cd servant-docs && doctest src)
84− (cd servant-foreign && doctest src)
85− (cd servant-server && doctest src)
86− (cd servant-machines && doctest src)
87− (cd servant-conduit && doctest src)
88− (cd servant-pipes && doctest src)
68+ DOCTEST="cabal repl --with-ghc=doctest --ghc-options=-w"
69+ (cd servant && eval $DOCTEST)
70+ (cd servant-client && eval $DOCTEST)
71+ (cd servant-client-core && eval $DOCTEST)
72+ (cd servant-http-streams && eval $DOCTEST)
73+ (cd servant-docs && eval $DOCTEST)
74+ (cd servant-foreign && eval $DOCTEST)
75+ (cd servant-server && eval $DOCTEST)
76+ (cd servant-machines && eval $DOCTEST)
77+ (cd servant-conduit && eval $DOCTEST)
78+ (cd servant-pipes && eval $DOCTEST)
8979
9080 stack:
9181 name: stack / ghc ${{ matrix.ghc }}
cabal.project−3
@@ -52,9 +52,6 @@ tests: True
5252optimization: False
5353-- reorder-goals: True
5454
55−-- needed for doctests
56−write-ghc-environment-files: always
57−
5855-- https://github.com/chordify/haskell-servant-pagination/pull/12
5956allow-newer: servant-pagination-2.2.2:servant
6057allow-newer: servant-pagination-2.2.2:servant-server
servant-client/src/Servant/Client/Internal/HttpClient.hs+1−1
@@ -246,7 +246,7 @@ defaultMakeClientRequest burl r = Client.defaultRequest
246246 where
247247 -- Content-Type and Accept are specified by requestBody and requestAccept
248248 headers = filter (\(h, _) -> h /= "Accept" && h /= "Content-Type") $
249− toList $requestHeaders r
249+ toList $ requestHeaders r
250250
251251 acceptHdr
252252 | null hs = Nothing
servant-swagger/servant-swagger.cabal+1−1
@@ -92,7 +92,7 @@ test-suite doctests
9292 build-depends:
9393 base,
9494 directory >= 1.0,
95− doctest >= 0.17 && <0.19,
95+ doctest >= 0.17 && <0.21,
9696 servant,
9797 QuickCheck,
9898 filepath