Start a group of containers with dependencies and shared cleanup
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- docker, node.js, typescript
Línea de trabajo
Read the existing GenericContainer and Network implementations under packages/testcontainers/src, then inspect how container startup and cleanup are handled. Design the group API from the issue’s sketch, including dependency ordering, parallel starts, shared network aliases, and stopping containers if a start fails; done means the group can start and dispose of a set of containers as described.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
A test that needs several containers wires them up by hand:
const network = await new Network().start();
const db = await new PostgreSqlContainer(dbImage).withNetwork(network).withNetworkAliases("db").start();
const app = await new GenericContainer(appImage)
.withNetwork(network)
.withEnvironment({ DATABASE_URL: "postgres://test:test@db:5432/test" })
.withExposedPorts(8080)
.start();
// ...
await app.stop();
await db.stop();
await network.stop();
- Start order is whatever order the
awaits are written in. Independent containers start one after another unless the test adds its ownPromise.all. - With
Promise.all, if onestart()rejects the others keep running until Ryuk removes them at process exit. - Cleanup is one call per container, in the right order.
Expected
A way to declare a set of containers, their dependencies and a shared network, start them as a unit and dispose of them as a unit:
await using group = await new ContainerGroup()
.with("db", new PostgreSqlContainer(dbImage))
.with("app", new GenericContainer(appImage).withExposedPorts(8080), { dependsOn: ["db"] })
.start();
const app = group.get("app");
- Containers without a dependency between them start in parallel.
- Each name becomes a network alias on a network the group owns.
- If any container fails to start, the ones already started are stopped.
Where
New code in packages/testcontainers/src, built on GenericContainer and Network.
Notes
- Java has
dependsOn(Startable...)on containers andStartables.deepStart(...)for parallel start. DockerComposeEnvironmentcovers this when the setup lives in a compose file. This is for setups defined in code, including module containers.- The API shape above is a sketch.
Dependencies
- Nothing blocks this. It can start now.
- Coordinate with #1536: a group puts its containers on a network with aliases.
- Coordinate with #1520: a group starts builders it was handed, so
start()must not change them.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.6k
- Forks
- 274
- Merge medio
- 1 d 14 h
- PR fusionados (30 d)
- 44
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de testcontainers/testcontainers-node
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
testcontainers/testcontainers-node#1539 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
testcontainers/testcontainers-node#1533 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
testcontainers/testcontainers-node#1531 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
testcontainers/testcontainers-node#1529 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
testcontainers/testcontainers-node#1528 ·
Los mantenedores suelen responder en 1 día
Todos los issues de testcontainers/testcontainers-node
Issues similares
-
affected/v17 affected/v18 area/frontend type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
umbraco/Umbraco-CMS#24186 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
better-auth/better-auth#11723 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
area: docs difficulty: easy documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Worker-Erstellung bricht langsame Git-Worktree-Checkouts nach 20 Sekunden abPosiblemente ocupada @KajoVanBuyten la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
AgentSystemLabs/agent-office#367 ·
Los mantenedores suelen responder en 1 día