#Run test with environment in dagger

1 messages · Page 1 of 1 (latest)

woeful lynx
#

I would like to run tests in dagger that needs a redis instance.

So my idea is to start first a redis container, then run the tests and after the tests, stop the redis container again.
Is that possible with dagger (sorry if that is a silly trivial question, but I'm stuck with that 🥲 ).

I have here 2 main problems.

  1. How to wait till my redis instance is up? (redis blocks, so it never 'completes')
  2. How to stop the redis instance again? There is a docker.#Run but I couldn't find a docker.#Stop
small ember
#

Hi @woeful lynx this is not yet available in Dagger, but will be soon. See https://github.com/dagger/dagger/pull/3123 for ongoing development

In the meantime, you can start your redis container outside of Dagger, and connect to it from your Dagger pipelines. Just make sure your redis server can receive network connections from the machine running the dagger engine

GitHub

This PR adds support for services, specifically:

Creating services (asynchronous containers)
Service control (listing, retrieving, stopping, ...)
tty streaming over WebSocket with CLI support (clo...

#

PS not at all a silly question 😁

hollow orchid
#

Let us know if decide to go this route and you're a bit lost on how to make your dagger pipelines connect to your local redis instance 🙏 .