Add endpoint and URL helpers for mapped ports
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/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 StartedTestContainer interface in packages/testcontainers/src/test-container.ts, then read StartedGenericContainer and AbstractStartedContainer in the two generic-container files listed in the issue. Trace how mapped ports and hosts are exposed, including IPv6 URL formatting. Done means both helpers return the specified endpoint and URL and the interface, implementation, and forwarder are updated.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
The most common line written against a started container is a hand-assembled address:
const url = `http://${container.getHost()}:${container.getMappedPort(8080)}`;
It appears throughout the docs and module sources, and every module re-implements it for its own URL getters. It is easy to get subtly wrong (forgetting the mapped port, hardcoding localhost).
Expected
Helpers on StartedTestContainer:
getEndpoint(port)returnshost:portgetUrl(port, scheme = "http")returnsscheme://host:port
const url = container.getUrl(8080);
Modules can build their own getters on these.
Where
packages/testcontainers/src/test-container.tspackages/testcontainers/src/generic-container/started-generic-container.tspackages/testcontainers/src/generic-container/abstract-started-container.ts
Notes
- Go has
Endpoint(ctx, proto)for the first exposed port andPortEndpoint(ctx, port, proto). - IPv6 hosts need brackets in a URL, which is one more reason to build it in one place.
- Related: #1538 (connection getter names across modules).
Dependencies
- Nothing blocks this. It can start now.
- Changes
StartedTestContainer, which today means the interface,StartedGenericContainerand the forwarder onAbstractStartedContainer. Several other issues do the same. The edits do not overlap, so they can go in parallel.
- 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
-
area:ui effort:S enhancement priority:P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
QuantumNous/new-api#7839 ·
Los mantenedores suelen responder en 1 día
-
good first issue maintenance
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
dark-princezz/stellar-hooks#1010 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
interledger/rhyza#352 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día