Expose WaitUntilReady constructors
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start by locating the WaitReady constructor and the module export list that currently keeps it private. Check how existing readiness checks are represented, then expose the constructor so callers can define custom database checks like the example. Confirm that the public API still builds and that a custom WaitUntilReady value can be constructed.
Written by the indexing model from the issue text.
Description
I'd like to add a custom check, a real connection to the database with a test query. Something like this:
mariaDBReady :: TestDBInfo -> WaitUntilReady
mariaDBReady db = WaitReady $ \container -> do
withFrozenCallStack $ do
let (endpointHost, endpointPort) = containerAddress container db.dbPort
ci =
defaultConnectInfo
{ connectHost = unpack endpointHost
, connectPort = fromIntegral endpointPort
, connectUser = unpack db.dbUsername
, connectPassword = unpack db.dbPassword
, connectDatabase = unpack db.dbName
}
wait = do
r <- try (connect ci >>= flip query_ "select 2 + 3")
case r of
Right [Only (i :: Int)] -> do
pure ()
Left (ex :: IOException) -> do
threadDelay 500000
wait
liftIO wait
This is currently not possible since WaitReady is not public.
- Dominant language
- Haskell
- Stars
- 77
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from testcontainers/testcontainers-hs
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
testcontainers/testcontainers-hs#59 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
testcontainers/testcontainers-hs#53 · 1 comment ·
-
Make it possible to customize 'ryuk' reaper configPossibly taken @rvem claimed this 913 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 42/100
testcontainers/testcontainers-hs#50 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
testcontainers/testcontainers-hs#42 · 5 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
testcontainers/testcontainers-hs#19 · 3 comments ·
All issues in testcontainers/testcontainers-hs
Similar issues
-
bug core-libs
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
content good first issue
Difficulty 2/5 Under an hour Newbie friendliness 88/100
StudentSuite/awesome-skills-plugins-for-students#312 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 96/100
alunduil/collection-json.hs#415 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
fmidue/prolog-programming-task#62 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
objectionary/phino#1951 ·
Maintainers usually reply within 1 day