Accept a boolean in the no-argument flag setters
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- docker, node.js, typescript
调研方向
Start with the listed generic container, builder, Docker Compose environment, and test files; compare the six no-argument setters with the existing boolean setters. Check the related work in #1524 and coordinate the shared TestContainer interface edit with #1529. Done means the flag setters accept an optional boolean defaulting to true, existing calls still work, conditional calls can turn flags off, and tests cover the behavior.
由索引模型根据 Issue 内容生成。
描述
What happens
On/off settings are spelled two ways.
No argument, can only switch on:
GenericContainer.withReuse()GenericContainer.withPrivilegedMode()GenericContainer.withDefaultLogDriver()DockerComposeEnvironment.withBuild()DockerComposeEnvironment.withNoRecreate()GenericContainerBuilder.withBuildkit()
Boolean argument:
GenericContainer.withAutoCleanup(boolean)GenericContainer.withAutoRemove(boolean)DockerComposeEnvironment.withAutoCleanup(boolean)GenericContainerBuilder.withCache(boolean)
The no-argument form breaks the chain for conditional settings and cannot undo a setting that a subclass or module turned on:
const container = new GenericContainer(image).withExposedPorts(8080);
if (!process.env.CI) {
container.withReuse();
}
The modules are split the same way: 6 no-argument flag setters and 4 that take a boolean.
Expected
Flag setters accept an optional boolean that defaults to true, so withReuse() keeps working and withReuse(!process.env.CI) becomes possible.
Where
packages/testcontainers/src/generic-container/generic-container.tspackages/testcontainers/src/generic-container/generic-container-builder.tspackages/testcontainers/src/docker-compose-environment/docker-compose-environment.tspackages/testcontainers/src/test-container.ts
Notes
- Java takes a boolean in both
withReuse(boolean reusable)andwithPrivilegedMode(boolean mode). - Worth adding the convention to the
add-moduleskill.
Dependencies
- Stack on #1524: both change
withNoRecreate. - Coordinate with #1529: both edit the
TestContainerinterface.
- 主要语言
- TypeScript
- 星标
- 2.7k
- 派生
- 290
- 平均合并
- 4 天 1 小时
- 30 天内合并 PR
- 22
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
testcontainers/testcontainers-node 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
testcontainers/testcontainers-node#1673 ·
维护者通常 4 天内回复
-
enhancement minor
难度 2/5 1-3 小时 新手友好度 74/100
testcontainers/testcontainers-node#1539 ·
维护者通常 4 天内回复
-
Let `Wait.forListeningPorts()` wait on specific ports可能已有人在做 @artbom 于 29 天前认领。 未关闭enhancement minor
难度 2/5 1-3 小时 新手友好度 82/100
testcontainers/testcontainers-node#1533 ·
维护者通常 4 天内回复
-
enhancement minor
难度 2/5 1-3 小时 新手友好度 77/100
testcontainers/testcontainers-node#1531 ·
维护者通常 4 天内回复
-
Export the types used in public method signatures可能已有人在做 @artbom 于 29 天前认领。 未关闭enhancement minor
难度 2/5 1-3 小时 新手友好度 78/100
testcontainers/testcontainers-node#1528 ·
维护者通常 4 天内回复
查看 testcontainers/testcontainers-node 的全部 Issue
相似的 Issue
-
prio:low scope:hud
难度 2/5 1-3 小时 新手友好度 78/100
OliverRomhagen/vrigstad-joyride#953 ·
维护者通常 1 天内回复
-
review-followup
难度 1/5 1 小时以内 新手友好度 92/100
griffinwork40/agent-afk#5446 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
kacper-szewczyk/Ticknest#346 ·
维护者通常 1 天内回复
-
echarts geo: a GeoJSON URL that returns 200 with a body that is not JSON is fetched on each refresh未关闭bug plugin/echarts/geo
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
Yeachan-Heo/gajae-code#8230 ·
维护者通常 1 天内回复