Basic copy_to implementation#242
Conversation
|
|
|
@jarlah this is the last missing feature for me to complete my library using testcontainers, I'd like to see this in 2.0 (it is a blocker for me). Anything I can help out to get this through? |
|
so sorry.. been awfully busy the last weeks. Actually been a heavy user of testcontainers actually and its not easy to admit that its not as stable as it should be hah |
|
first off the hash test thats because you introduced new struct field in container. So thats easy to fix. Just use the new hash in the test. |
|
ill look into this and the other PR now, plus the AWFUL flakyness of the ryuk connection initialization! Im running two production projects and im not kidding when i say that ryuk fails so many times ai is skipping running tests all together from time to time .. |
|
haha sorry @gossi i destroyed this PR by syncing it. But anway. Master should be extremely more stable now. for ex just see here from a local run, only the periodically 1 in 10 flaky kafka test left its also possible to run tests completely offline. For ex when on a plane and you just want to run a couple of tests when you have all images locally. |
|
im making a new version from this. Actually, i think i will release version 2.0.0-rc2. Then, after using it for a couple of days, checking its more resilient, release 2.0.0 end of week |
|
v2.0.0-rc2 released. Will use it on my two prod apps this coming week |
gossi
left a comment
There was a problem hiding this comment.
The hash fixes were the easy parts ;)
I run into couple others:
- Creating, starting and waiting was (and is) inconsistent (see my comments on ryuk, that reveal that)
- I tried to make the API a bit more explicit (one function each for creating, starting and waiting) - I got quite far I'd say
- I wanted to solve my connreset problem, I fixed the inotify problem
I still have this issue:
1) test copy contents to target (CopyToTest)
Error: test/copy_to_test.exs:5
** (MatchError) no match of right hand side value: {:error, :socket_closed_remotely}
code: {:ok, %{body: body}} = Tesla.get("[http://127.0.0.1:#{mapped_port}/hello.txt](http://127.0.0.1/#{mapped_port}/hello.txt)")
stacktrace:
test/copy_to_test.exs:18: (test)
So, locally when running the tests, it's green and clear. I think this is a race condition when running this on GH actions, although I have no idea which socket is closed (docker, nginx 🤷).
I tried with and without http wait strategy, seems like something else decides to kill some process here.
Anything we can do to make that execution stable?
|
ha! you made the http strategy stable and my PR is green now - WoW! Please have a look :) |
jarlah
left a comment
There was a problem hiding this comment.
Nice job, :) Sorry about the "thumbs down" but i feel the amount of changes in the core startup logic is too much just for a copy to container logic. Can you scope it down? to just copy to container logic? e.g. as little as changes required to get it working ?
|
there is always a chance i didnt understand the reasoning behind the changes too, so 🐻 that in mind |
jarlah
left a comment
There was a problem hiding this comment.
Nice. Short and to the point 🙂
| ] | ||
| end | ||
|
|
||
| def cli do |
There was a problem hiding this comment.
You know this. God i hate to supply MIX_ENV=test every single time. If this fixes that your my hero 😅
There was a problem hiding this comment.
the other was deprecated, I followed what the link told me to do 😀
|
yup, you also made changes meanwhile that improved the situation. Reverted to make the changed surface smaller 👍 |
|
@gossi are you ok with me squashing or do you want to rebase your 14 commits ? |
|
go squash :) |
|
nah still not working .. but it was a good try back to MIX_ENV=test mix test :/ |
|
@jarlah thanks for merging 🧡 Do you mind dropping a rc4 for this, so I can continue on my other project? |
|
i was actuall thinking 2.0.0. Because i have tested its core extensively the last days :) Is that ok for you ? |
|
yay! even better :] |
Impl for #240
I did some research for the API in rust and node clients:
with_copy_towithCopyContentToContainer()withCopyDirectoriesToContainer()withCopyFilesToContainer()withCopyArchivesToContainer()For elixir, I choose the method from rust
with_copy_toand then use pattern matching against the cases.I personally only need one case here and did the impl for the most basic one 🙈.