Add endpoint and URL helpers for mapped ports
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
- 76/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 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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- 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ó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
QuantumNous/new-api#7839 ·
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
Maintainer thường phản hồi trong vòng 1 ngày
-
bug p2 triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getpaseo/paseo#7071 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
test: make the #3408 Claude OAuth token fixture obviously fake so secret scanners stop flagging itĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
code-yeongyu/senpi#3436 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
lingdojo/kana-dojo#32505 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày