Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to declare sidecar containers for tests and development #63

Open
NiklasRosenstein opened this issue Jul 2, 2023 · 0 comments · May be fixed by #67
Open

Add feature to declare sidecar containers for tests and development #63

NiklasRosenstein opened this issue Jul 2, 2023 · 0 comments · May be fixed by #67
Assignees
Labels
only: kraken-std This issue affects only kraken-std. type: enhancement New feature or request

Comments

@NiklasRosenstein
Copy link
Contributor

Sidecar containers are often required for testing, such as having a Postgres database available while running integration tests. These containers should be configurable in a Kraken build script, and it should be possible to start these containers directly and also have them start for tests.

In the build script, an example container definition may be:

from kraken.std.devenv import sidecar_container

sidecar_container(
  name="postgres",
  image="postgres:latest",
  ports=["5432:5432"],
  env={"POSTGRES_PASSWORD": "alpine"},
)

This should produce two targets, :postgres.start and :postgres.run. The :postgres.start task starts up the container in the background. The :postgres.run command is intended to be used on the CLI to wait for the container to complete or to cancel it when the task is interrupted.

For tests, the :postgres.start command would simply need to be a dependency on the task that runs the tests. It being a background task, the Postgers container will stay alive until the tests have completed.

@NiklasRosenstein NiklasRosenstein added type: enhancement New feature or request only: kraken-std This issue affects only kraken-std. labels Jul 2, 2023
@NiklasRosenstein NiklasRosenstein self-assigned this Jul 2, 2023
@NiklasRosenstein NiklasRosenstein linked a pull request Jul 3, 2023 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
only: kraken-std This issue affects only kraken-std. type: enhancement New feature or request
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant