feat: Providing tests for ComposeDown#50
Conversation
This provies the missing tests for PR Mcrich23#39
d4a37ab to
5991999
Compare
ComposeDown
|
This looks great! Thank you so much. Going to do a quick code review right now. |
Mcrich23
left a comment
There was a problem hiding this comment.
After taking a deeper look, it mostly feels good, but I have some specific requests regarding tests to make sure our tests are robust and strong to bring into the future of Container-Compose.
| containers.count == 2, | ||
| "Expected 2 containers for \(project.name), found \(containers.count)") | ||
| #expect( | ||
| containers[0].status == .running, |
There was a problem hiding this comment.
Could you please make this check that all of these containers are running instead of just the first one?
There was a problem hiding this comment.
adjusted it, but somehow this fails on my machine now, since it can't start the Wordpress container, but that might be a different bug :(
There was a problem hiding this comment.
Interesting. Try manually restarting the container subsystem
|
@oxisto I made a couple testing expect changes to be more dynamic. When running tests though, it seems that wordpress is receiving an invalid argument. But it still works on main's tests, meaning that wordpress didn't change something. Can you please take a look at your tests? |
Thanks! Yeah it's weird, it seems either web or Wordpress is not be able to start but it basically uses the same code as in the "up" test. The only thing I changed is that I extracted the "run" into a utility function and maybe this utility function is doing slightly different things, I'll take a look. |
FYI the wordpress test-case also "fails" on the "up" tests, the wordpress container is not starting correctly because it can no connect other the DB. you can see that on the test logs but the test is actually not asserting that it is running. |
|
getIPForRunningService is returning the wrong IP address, it returns the address of the gateway, but it should return the address of the container |
how so? It checks that all containers have the running status. |
No it does not :) Check testWordPressCompose(), that does NOT check the running status. TestComplexDependencyChain() DOES. The Wordpress container has several problems and should probably not be used. It tries to copy data into the volume, which fails horribly on named containers because of path issues and it fails even on non-named containers because of permission problems. |
|
Ah yes, you are correct about that check. Thats a bad test |
|
I am going to merge this and then we can replace wordpress as a separate pr. |
This PR adds a dynamic tests for
ComposeDownand incorporates the fix of #39 to correctly handle container_name.