Let a configured container be cloned and customised with functions
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- docker, node.js, typescript
Línea de trabajo
Start with the dependency, issue #1520, since this issue says clone() depends on its builder state being made copyable. Then read packages/testcontainers/src/generic-container/generic-container.ts and packages/testcontainers/src/test-container.ts to see how builder state and subclass state are handled. Done means clone() returns an independent builder of the same class and with(fn) applies a customizer in the chain; run the relevant tests in the test-container file.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
A configured container cannot be used as a template. Builders are mutable and every with* method returns the same object:
const base = new GenericContainer(image).withEnvironment({ LOG_LEVEL: "debug" });
const a = base.withName("a");
const b = base.withName("b");
// a, b and base are one object, named "b"
Shared configuration therefore lives in factory functions, and a reusable piece of configuration has to be applied outside the chain:
const container = new PostgreSqlContainer(image).withDatabase("orders");
applyTracing(container);
await container.start();
Expected
clone()returns an independent copy of the builder, of the same class.with(fn)applies a function inside the chain:
const withTracing = <T extends GenericContainer>(container: T) => container.withEnvironment({ OTEL_ENABLED: "true" });
await new PostgreSqlContainer(image).withDatabase("orders").with(withTracing).start();
Where
packages/testcontainers/src/generic-container/generic-container.ts and packages/testcontainers/src/test-container.ts.
Notes
- Go models reusable configuration as
ContainerCustomizervalues passed toRun. clone()needs the builder's state to be copyable in one place, including what subclasses add.
Dependencies
- Blocked by #1520:
clone()needs the builder state to be copyable, which is what that fix introduces.
- 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
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
xdjs/MusicNerdWeb#1532 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
sebastian-software/ardo#352 ·
Los mantenedores suelen responder en 1 día
-
@react95/core good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 3 días
-
@shikijs/stream: `ShikiStreamTokenizer.clone()` shares its `tokensStable` array with the originalPosiblemente ocupada @xyrolle la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día