Skip to content

Commit db4cb1e

Browse files
committed
Update CI image
1 parent 4b4e69e commit db4cb1e

5 files changed

Lines changed: 20 additions & 14 deletions

File tree

.github/workflows/haskell-ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ on:
1919
jobs:
2020
linux:
2121
name: Haskell-CI - Linux - ${{ matrix.compiler }}
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-22.04
2323
timeout-minutes:
2424
60
2525
container:
26-
image: buildpack-deps:bionic
26+
image: buildpack-deps:jammy
2727
continue-on-error: ${{ matrix.allow-failure }}
2828
strategy:
2929
matrix:
30+
redis-version: [6,7]
3031
include:
3132
- compiler: ghc-9.4.8
3233
compilerKind: ghc
@@ -43,11 +44,6 @@ jobs:
4344
compilerVersion: 9.8.4
4445
setup-method: ghcup
4546
allow-failure: false
46-
- compiler: ghc-9.10.2
47-
compilerKind: ghc
48-
compilerVersion: 9.10.2
49-
setup-method: ghcup
50-
allow-failure: false
5147
fail-fast: false
5248
steps:
5349
- name: apt
@@ -184,6 +180,10 @@ jobs:
184180
- name: build
185181
run: |
186182
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
183+
- name: Start Redis
184+
uses: supercharge/redis-github-action@1.7.0
185+
with:
186+
redis-version: ${{ matrix.redis-version }}
187187
- name: tests
188188
run: |
189189
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct

hedis.cabal

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ flag dev
6464
default: False
6565
manual: True
6666

67+
flag cluster
68+
description: enable it to run cluster tests if you have required setup
69+
default: False
70+
manual: True
71+
6772
library
6873
default-language: Haskell2010
6974
hs-source-dirs: src
@@ -209,8 +214,9 @@ test-suite hedis-test-cluster
209214
ghc-options: -O0 -Wall -rtsopts -fno-warn-unused-do-bind
210215
if flag(dev)
211216
ghc-options: -Werror
212-
if flag(dev)
213217
ghc-prof-options: -auto-all
218+
if !flag(dev)
219+
buildable: False
214220

215221
test-suite hedis-test-hooks
216222
default-language: Haskell2010

src/Database/Redis/URL.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ import qualified Data.ByteString.Char8 as C8
2828
-- Username is ignored, path is used to specify the database:
2929
--
3030
-- >>> parseConnectInfo "redis://username:password@host:42/2"
31-
-- Right (ConnInfo {connectHost = "host", connectPort = PortNumber 42, connectAuth = Just "password", connectUsername = Just "username", connectDatabase = 2, connectMaxConnections = 50, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing})
31+
-- Right (ConnInfo {connectHost = "host", connectPort = PortNumber 42, connectAuth = Just "password", connectUsername = Just "username", connectDatabase = 2, connectMaxConnections = 50, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing, connectHooks = Hooks {sendRequestHook = _, sendPubSubHook = _, callbackHook = _, sendHook = _, receiveHook = _}})
3232
--
3333
-- >>> parseConnectInfo "redis://username:password@host:42/db"
3434
-- Left "Invalid port: db"
3535
--
3636
-- The scheme is validated, to prevent mixing up configurations:
3737
--
3838
-- >>> parseConnectInfo "postgres://"
39-
-- Left "Wrong scheme"
39+
-- Left "Wrong scheme postgres:"
4040
--
4141
-- Beyond that, all values are optional. Omitted values are taken from
4242
-- @'defaultConnectInfo'@:
4343
--
4444
-- >>> parseConnectInfo "redis://"
45-
-- Right (ConnInfo {connectHost = "localhost", connectPort = PortNumber 6379, connectAuth = Nothing, connectUsername = Nothing, connectDatabase = 0, connectMaxConnections = 50, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing})
45+
-- Right (ConnInfo {connectHost = "localhost", connectPort = PortNumber 6379, connectAuth = Nothing, connectUsername = Nothing, connectDatabase = 0, connectMaxConnections = 50, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing, connectHooks = Hooks {sendRequestHook = _, sendPubSubHook = _, callbackHook = _, sendHook = _, receiveHook = _}})
4646
--
4747
parseConnectInfo :: String -> Either String ConnectInfo
4848
parseConnectInfo url = do

test/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ main = do
1111
Test.defaultMain (tests conn)
1212

1313
tests :: Connection -> [Test.Test]
14-
tests conn = map ($conn) $ concat
14+
tests conn = map ($ conn) $ concat
1515
[ testsMisc, testsKeys, testsStrings, [testHashes], testsLists, testsSets, [testHyperLogLog]
1616
, testsZSets, [testPubSub], [testTransaction], [testScripting]
1717
, testsConnection, testsClient, testsServer, [testScans, testSScan, testHScan, testZScan], [testZrangelex]

test/Tests.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ testEvalReplies :: Test
118118
testEvalReplies conn = testCase "eval unused replies" go conn
119119
where
120120
go = do
121-
_ <- liftIO $ runRedis conn $ set "key" "value"
121+
_ <- liftIO $ runRedis conn $ set "key-12" "value"
122122
result <- liftIO $ do
123123
threadDelay $ 10 ^ (5 :: Int)
124124
mvar <- newEmptyMVar
125125
_ <-
126-
(Async.wait =<< Async.async (runRedis conn (get "key"))) >>= putMVar mvar
126+
(Async.wait =<< Async.async (runRedis conn (get "key-12"))) >>= putMVar mvar
127127
takeMVar mvar
128128
pure result >>=? Just "value"
129129

0 commit comments

Comments
 (0)