Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Document and align the units of sizes and durations

Đang mở
#1,542 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Lĩnh vực
api, testing

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ả

enhancement minor

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 }) and withSharedMemorySize(512 * 1024 * 1024).
  • logs({ since }) is the only time value in seconds. It is passed straight to Docker, so a millisecond timestamp such as Date.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 a Date.
  • Decide whether sizes should share one unit.

Where

  • packages/testcontainers/src/types.ts
  • packages/testcontainers/src/test-container.ts
  • packages/testcontainers/src/generic-container/generic-container.ts
  • packages/testcontainers/src/wait-strategies/composite-wait-strategy.ts

Notes

  • Semver: JSDoc and accepting a Date are additive, hence minor. Changing the unit of an existing option would be major.
  • 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

Mở trong Codespaces

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.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của testcontainers/testcontainers-node

Tất cả issue của testcontainers/testcontainers-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.