Make the port optional in `Wait.forHttp`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 82/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- docker, node.js, typescript
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 2.6k
- 派生
- 278
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 61
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 小时 新手友好度 72/100
grafana/profiles-drilldown#1212 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
grafana/traces-drilldown#980 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
openremote/openremote#3487 · 1 条评论 ·
-
triage:needs-human
难度 2/5 1-3 小时 新手友好度 67/100
garrytan/gbrain#7635 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
coollabsio/jean#867 ·
维护者通常 1 天内回复