Let a configured container be cloned and customised with functions
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ính năng
- Độ rõ ràng
- Đặc tả 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 dependency, issue #1520, since this issue says clone() depends on its builder state being made copyable. Then read packages/testcontainers/src/generic-container/generic-container.ts and packages/testcontainers/src/test-container.ts to see how builder state and subclass state are handled. Done means clone() returns an independent builder of the same class and with(fn) applies a customizer in the chain; run the relevant tests in the test-container file.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
A configured container cannot be used as a template. Builders are mutable and every with* method returns the same object:
const base = new GenericContainer(image).withEnvironment({ LOG_LEVEL: "debug" });
const a = base.withName("a");
const b = base.withName("b");
// a, b and base are one object, named "b"
Shared configuration therefore lives in factory functions, and a reusable piece of configuration has to be applied outside the chain:
const container = new PostgreSqlContainer(image).withDatabase("orders");
applyTracing(container);
await container.start();
Expected
clone()returns an independent copy of the builder, of the same class.with(fn)applies a function inside the chain:
const withTracing = <T extends GenericContainer>(container: T) => container.withEnvironment({ OTEL_ENABLED: "true" });
await new PostgreSqlContainer(image).withDatabase("orders").with(withTracing).start();
Where
packages/testcontainers/src/generic-container/generic-container.ts and packages/testcontainers/src/test-container.ts.
Notes
- Go models reusable configuration as
ContainerCustomizervalues passed toRun. clone()needs the builder's state to be copyable in one place, including what subclasses add.
Dependencies
- Blocked by #1520:
clone()needs the builder state to be copyable, which is what that fix introduces.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.6k
- Fork
- 277
- Merge trung bình
- 1 ngày 53 phút
- Pull request đã merge (30 ngày)
- 58
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ự
-
area:editor bug issue-form:bug P0 platform:windows review: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
1lck/Lithe-IDEA#1388 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(api): isToolAuditEnabled swallows database read errors on auditToolOperations without loggingĐang mởarea: backend bug priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
snapotter-hq/SnapOtter#3238 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
rig up --plan times out after 5 s and reports an UNKNOWN outcome while the daemon completes the planĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
filesystem: search_files does not expand non-wildcard excludePatterns like directory_tree doesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/servers#5216 ·
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 76/100
Maintainer thường phản hồi trong vòng 1 ngày