Unify the copy-to-container methods and add reading a file from a container
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tính năng
- Độ 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 four listed files and trace how copy methods, options, and StartedTestContainer are implemented and forwarded. Review #1522 and coordinate with #1518 before changing the shared copy API. Done means unified before and after start copy methods with matching options and behavior, a way to read one file, and deprecated aliases for existing methods.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
Copying into a container is spread over nine methods with slightly different shapes.
Before start:
withCopyFilesToContainer(files[])withCopyDirectoriesToContainer(directories[])withCopyContentToContainer(contents[])withCopyArchivesToContainer(archives[])withCopyToContainerOptions(options)
After start:
copyFilesToContainer(files[])copyDirectoriesToContainer(directories[])copyContentToContainer(contents[])copyArchiveToContainer(tar, target?, options?)
The two sides do not behave the same (from reading the code):
DirectoryToCopy.modeis applied before start and ignored after start.CopyToContainerOptionsapplies to every copy before start, but after start onlycopyArchiveToContaineraccepts it.- The archive method is plural with an array before start, singular with positional arguments after.
Copying out is limited to copyArchiveFromContainer(path), which resolves to a tar stream. Reading one file's content means bringing a tar parser.
Expected
- One
withCopyToContainerand onecopyToContainerthat accept a list of entries, each a host path, inline content or an archive, withtargetandmode. The same options and behaviour on both sides. - A way to read a single file from a container, for example
readFile(path): Promise<Buffer>orcopyFileFromContainer(path, destination). - The existing methods stay as deprecated aliases.
Where
packages/testcontainers/src/test-container.tspackages/testcontainers/src/generic-container/generic-container.tspackages/testcontainers/src/generic-container/started-generic-container.tspackages/testcontainers/src/types.ts
Notes
- Java has
withCopyToContainer(Transferable, containerPath)andwithCopyFileToContainer(MountableFile, containerPath), pluscopyFileFromContainer(containerPath, destinationPath)and a variant that passes the file'sInputStreamto a function. Go hasFiles []ContainerFileon the request andCopyFileFromContainer, which returns the file's content. - Related: #1526. The
modefield should say it is an octal permission.
Dependencies
- Stack on #1522: the reuse hash has to cover copied files. Changing how copies are stored first would move that target.
- Coordinate with #1518: for the old method names.
- Changes
StartedTestContainer, which today means the interface,StartedGenericContainerand the forwarder onAbstractStartedContainer. Several other issues do the same. The edits do not overlap, so they can go in parallel.
- 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ự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
juice-shop/juice-shop#3686 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dsh-market/dsh-market#877 ·
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 82/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
ScottKirvan/GOMAC#61 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
stellar/stellar-dev-skill#151 ·
Maintainer thường phản hồi trong vòng 1 ngày