Document and align the units of sizes and durations
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá 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 listed files: packages/testcontainers/src/types.ts, test-container.ts, generic-container/generic-container.ts, and wait-strategies/composite-wait-strategy.ts. Document each numeric option's unit in JSDoc and add Date support for logs({ since }); the issue leaves the shared size unit decision open, and any unit change needs a major release. Done means the units are documented and Date is accepted, with the size decision resolved.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
Numeric options use different units, and most of them say so only in the docs, or nowhere:
| Option | Unit | Stated in the type or JSDoc |
|---|---|---|
withResourcesQuota({ memory }) |
gigabytes | inline comment |
withResourcesQuota({ cpu }) |
CPUs | inline comment |
withSharedMemorySize(bytes) |
bytes | parameter name |
withStartupTimeout(startupTimeoutMs) |
milliseconds | parameter name |
HealthCheck.interval, timeout, startPeriod |
milliseconds | no |
stop({ timeout }), restart({ timeout }) |
milliseconds | no |
Compose down({ timeout }) |
milliseconds | no |
HttpWaitStrategy.withReadTimeout |
milliseconds | parameter name |
CompositeWaitStrategy.withDeadline(deadline) |
milliseconds | no |
logs({ since }) |
Unix timestamp in seconds | no |
Two stand out:
- Memory is in gigabytes while shared memory is in bytes, so the same container can be configured with
withResourcesQuota({ memory: 0.5 })andwithSharedMemorySize(512 * 1024 * 1024). logs({ since })is the only time value in seconds. It is passed straight to Docker, so a millisecond timestamp such asDate.now()is read as a time far in the future.
Expected
- Every numeric option documents its unit in JSDoc, so it shows in the editor.
logs({ since })also accepts aDate.- Decide whether sizes should share one unit.
Where
packages/testcontainers/src/types.tspackages/testcontainers/src/test-container.tspackages/testcontainers/src/generic-container/generic-container.tspackages/testcontainers/src/wait-strategies/composite-wait-strategy.ts
Notes
- Semver: JSDoc and accepting a
Dateare additive, henceminor. Changing the unit of an existing option would bemajor. - Related: #734 (memory quota units).
Dependencies
- Nothing blocks this. It can start now.
- 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ó 1/5 1-3 giờ Mức phù hợp với người mới 70/100
siyuan-note/siyuan#20517 ·
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
NaturalIntelligence/fast-xml-parser#890 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
zsviczian/obsidian-excalidraw-plugin#3000 ·
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 68/100
pnpm/get.pnpm.io#68 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nuxt-modules/better-auth#578 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày