Feature/startup certain services#1528
Feature/startup certain services#1528rnorth merged 14 commits intotestcontainers:masterfrom HaMatthias:feature/startup-certain-services
Conversation
|
Solves #1497. |
rnorth
left a comment
There was a problem hiding this comment.
Only some trivial suggestions from me, otherwise looks good!
| private void createServices() { | ||
| // Run the docker-compose container, which starts up the services | ||
| runWithCompose("up -d"); | ||
| runWithCompose("up -d " + String.join(" ", this.services)); |
There was a problem hiding this comment.
In the case of services being an empty list, the run command will be "up -d ". I know that for Docker Compose this is functionally identical and starts all services.
However, just to be explicit in our code, could we perhaps do an if/else check around this, and only concatenate the services list onto "up -d" if necessary?
I'm fine to have the up string duplicated in the code.
You might also notice that I'm being a hypocrite about explicitness of code, when the original -d here is itself not very clear 😁. If you wouldn't mind changing -d to --detach while you're editing the code, that would be another improvement.
There was a problem hiding this comment.
| runWithCompose("up -d " + String.join(" ", this.services)); | |
| if(services.empty()) { | |
| runWithCompose("up -d"); | |
| } else { | |
| runWithCompose("up -d " + String.join(" ", services)); | |
| } |
Would that be fine to you? Clearer separation is always better!
Note: The older versions of docker-compose do not support --detach (e.g. my version of 1.17.1). So that is why I would let it like that? Thanks for your suggestion :)
.gitignore
Outdated
| src/pip-delete-this-directory.txt | ||
|
|
||
| .DS_Store | ||
| .directory |
There was a problem hiding this comment.
I'm not against adding things to .gitignore, but it looks like this might have been added accidentally.
There was a problem hiding this comment.
That was not any accident. My OS generates this file, when the directory should show dot-files in the UI ;).
There was a problem hiding this comment.
I've never seen .directory being generated before. What's your OS? 😄
If this is something that's fairly unique to your development environment, perhaps this belongs in your global gitignore rather than in individual repos.
There was a problem hiding this comment.
I am working with Dolphin on Ubuntu 18.04.2 LTS.
I will remove it, due to making global settings of it. Did some research.
core/src/test/java/org/testcontainers/junit/DockerComposeServiceTest.java
Show resolved
Hide resolved
|
Would be really nice to have this feature in master. I really need to work with it and I am struggling to create my own .jar with all these dependencies (shadow Jar - especially the namespace |
|
Requested changes are done. |
|
@rnorth bump |
|
How is the status of that? I would also need this :) |
|
This was released in 1.11.4 🎉 Thank you for the contribution! |
Added the feature of setting certain services, defined in the docker-compose.yml to be started.