Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose CopyToContainer so file can be created only in memory #417

Merged
merged 1 commit into from
Mar 29, 2022

Conversation

oktalz
Copy link
Contributor

@oktalz oktalz commented Mar 19, 2022

this is especially useful in tests, since we do not
need to create a file for testing,
we can just generate it in memory and then
copy it to a container directly

this is especially useful in tests, since we do not
need to create a file for testing,
we can just generate it in memory and then
copy it to a container directly
@@ -395,7 +395,11 @@ func (c *DockerContainer) CopyFileToContainer(ctx context.Context, hostFilePath
if err != nil {
return err
}
return c.CopyToContainer(ctx, fileContent, containerFilePath, fileMode)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

@mdelapenya mdelapenya self-assigned this Mar 22, 2022
@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label Mar 22, 2022
@codecov
Copy link

codecov bot commented Mar 22, 2022

Codecov Report

Merging #417 (1703875) into master (fea599d) will decrease coverage by 0.14%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #417      +/-   ##
==========================================
- Coverage   65.38%   65.24%   -0.15%     
==========================================
  Files          19       19              
  Lines        1170     1171       +1     
==========================================
- Hits          765      764       -1     
- Misses        300      301       +1     
- Partials      105      106       +1     
Impacted Files Coverage Δ
container.go 87.23% <ø> (ø)
docker.go 65.61% <100.00%> (-0.31%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fea599d...1703875. Read the comment docs.

@mdelapenya mdelapenya requested a review from gianarb March 23, 2022 09:02
@mdelapenya mdelapenya merged commit 699cce9 into testcontainers:master Mar 29, 2022
@oktalz oktalz deleted the feat/copyfilefrommemory branch November 22, 2022 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or new behaviors on the existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants