Make the port optional in `Wait.forHttp`
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 82/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, node.js, typescript
Hướng nghiên cứu
Start with packages/testcontainers/src/wait-strategies/wait.ts and packages/testcontainers/src/wait-strategies/http-wait-strategy.ts to trace how Wait.forHttp creates the HTTP wait strategy and how exposed ports are available. Check the existing API and tests for Wait.forHttp, then add coverage for defaulting to the first exposed port, fluent .forPort(8081), and the existing Wait.forHttp(path, port) call. Done means all three forms work.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
Wait.forHttp(path, port, options) requires the port, even for the usual case of a container with one exposed port:
new GenericContainer(image)
.withExposedPorts(8080)
.withWaitStrategy(Wait.forHttp("/health", 8080));
The port is repeated, and in a module it has to be kept in step with the exposed port by hand. Because options is the third positional parameter, it cannot be passed without the port.
Expected
- The port is optional and defaults to the first exposed port.
- The port can be set fluently, for example
Wait.forHttp("/health").forPort(8081). Wait.forHttp(path, port)keeps working.
Where
packages/testcontainers/src/wait-strategies/wait.tspackages/testcontainers/src/wait-strategies/http-wait-strategy.ts
Notes
- Java's
Wait.forHttp(String path)takes only the path, uses the container's first exposed port by default, and hasforPort(int)andWait.forHttps(path). - Related: #1507, which is about the
optionsargument (abortOnContainerExit).
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ự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 70/100
siyuan-note/siyuan#20517 ·
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 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
zsviczian/obsidian-excalidraw-plugin#3000 ·
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 68/100
pnpm/get.pnpm.io#68 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nuxt-modules/better-auth#578 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày