Add `inspect()` and state accessors to started containers
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, typescript
Hướng nghiên cứu
Read the listed StartedTestContainer and StartedGenericContainer files, then trace how InspectResult is received by the start hooks and mapped in map-inspect-result.ts. Check types.ts for the result shape and inspect existing tests around container state. Done when started containers expose a fresh inspect result and the requested state accessors, with exit code represented in InspectResult.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
A started container exposes its id, name, labels, hostname and network details, all captured when it started. It has no way to ask about its current state:
- Is it still running?
- What was the exit code?
- What is the health status?
- What does a fresh inspect say?
InspectResult is an exported type, but only the containerStarting/containerStarted hooks ever receive one. Everyone else has to go through the runtime client and Dockerode:
const client = await getContainerRuntimeClient();
const info = await client.container.inspect(client.container.getById(container.getId()));
That returns Dockerode's ContainerInspectInfo, not the library's InspectResult.
Expected
On StartedTestContainer:
inspect(): Promise<InspectResult>for a fresh result- convenience accessors built on it, for example
isRunning()andgetExitCode()
InspectResult gains what those need (exit code).
Where
packages/testcontainers/src/test-container.tspackages/testcontainers/src/generic-container/started-generic-container.tspackages/testcontainers/src/utils/map-inspect-result.tspackages/testcontainers/src/types.ts
Notes
- Java has
isRunning(),isHealthy(),getContainerInfo()andgetCurrentContainerInfo(). Go hasInspect(ctx),State(ctx)andIsRunning(). - Useful for one-shot containers (wait for exit, read the exit code) and for assertions in tests that deliberately kill a container.
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ự
-
Create/import wallet form shows raw "password must be at least 1 characters" instead of the translated messageCó thể đã có người làm @CapThunder19 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
joinmarket-webui/jam#1538 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
t0ggles
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nolimits4web/swiper#8240 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
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 72/100
modelcontextprotocol/inspector#2723 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:approved type:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
egdev6/quorb#109 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày