Add `inspect()` and state accessors to started containers
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 76/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- docker, typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 2.6k
- フォーク
- 274
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 44
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
testcontainers/testcontainers-node のほかの issue
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
testcontainers/testcontainers-node#1539 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
testcontainers/testcontainers-node#1533 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
testcontainers/testcontainers-node#1531 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
testcontainers/testcontainers-node#1529 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
testcontainers/testcontainers-node#1528 ·
メンテナーはふだん 1 日以内に返信
testcontainers/testcontainers-node の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/rocketmq-dashboard#6872 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
fab-geocommuns/RNB-site#539 ·
メンテナーはふだん 2 日以内に返信
-
Guest multiview tile label leaks raw virtual-source-id "Whip" instead of the guest name / slot labelオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Eyevinn/open-live-studio#211 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue
難易度 2/5 半日 初心者へのやさしさ 72/100
sujithputta02/Esapay#13 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ehmpathy/rhachet-roles-bhuild#468 ·
メンテナーはふだん 1 日以内に返信