Address Compose containers by service name
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker-compose, typescript
- Lĩnh vực
- devtools, testing-qa
Hướng nghiên cứu
Start by reading packages/testcontainers/src/docker-compose-environment/docker-compose-environment.ts and started-docker-compose-environment.ts, then trace the compose name parsing entry point in packages/testcontainers/src/docker-runtime/clients/compose/parse-compose-container-name.ts. Check how containers are identified and how wait strategies and getContainer resolve them; done means those APIs accept service names with an optional replica index while retaining container-name support, and the constructor parameter is named for the directory it receives.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
DockerComposeEnvironment identifies containers by container name, not by the service name written in the compose file:
const environment = await new DockerComposeEnvironment(dir, "docker-compose.yml")
.withWaitStrategy("redis-1", Wait.forLogMessage("Ready to accept connections"))
.up();
const redis = environment.getContainer("redis-1");
- The
-1suffix is a Compose naming detail the user has to know. - A service with
container_name:set is keyed by that name instead. - A wait strategy registered under the service name (
"redis") matches nothing.up()now logs a warning for that case, and the docs carry a callout, but the default wait strategy is still what runs. getContainer("redis")throwsCannot get container "redis" as it is not running.
The first constructor parameter is also misnamed: composeFilePath is the directory that contains the compose files, and the docs assign it "/path/to/build-context".
Expected
withWaitStrategyandgetContaineraccept a service name, with an optional replica index, and keep accepting a container name.- The constructor parameter is named for what it is.
Where
packages/testcontainers/src/docker-compose-environment/docker-compose-environment.tspackages/testcontainers/src/docker-compose-environment/started-docker-compose-environment.tspackages/testcontainers/src/container-runtime/clients/compose/parse-compose-container-name.ts
Notes
- Java uses service names throughout:
waitingFor(serviceName, strategy),getServiceHost(serviceName, port),getContainerByServiceName(serviceName), with an optional instance number onwithExposedService. Go hasServiceContainer(ctx, svcName)andWaitForService(name, strategy). - Compose labels each container with
com.docker.compose.serviceandcom.docker.compose.container-number, so resolving a service does not need name parsing. - Related: #647.
Dependencies
- Nothing blocks this. It can start now.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.6k
- Fork
- 274
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 44
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của testcontainers/testcontainers-node
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
testcontainers/testcontainers-node#1539 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
testcontainers/testcontainers-node#1533 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
testcontainers/testcontainers-node#1531 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
testcontainers/testcontainers-node#1529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
testcontainers/testcontainers-node#1528 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của testcontainers/testcontainers-node
Issue tương tự
-
e2e-failure ready-to-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
redhat-developer/rhdh-plugin-export-overlays#4391 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Luligu/matterbridge#655 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
software-mansion/argent#1457 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
schmayterling/hibi#245 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
linagora/twake-contacts-frontend#241 ·
Maintainer thường phản hồi trong vòng 1 ngày