Add documentation for DependsOn#5597
Merged
eddumelendez merged 3 commits intotestcontainers:masterfrom Jul 13, 2022
Merged
Conversation
Member
There was a problem hiding this comment.
thanks for the PR @QuinnBast ! not a native speaker but I made a suggestion on the wording. Please run ./gradlew spotlessApply
docs/features/startup_and_waits.md
Outdated
|
|
||
| ## Depending on another container | ||
|
|
||
| When using multiple containers, it is possible that one container that you are starting relies on the other to be started before it should be started itself. An example of this might be a database that needs to be started before your application container can link to it. You can tell a container that it depends on another container by using the `dependsOn` method: |
Member
There was a problem hiding this comment.
Suggested change
| When using multiple containers, it is possible that one container that you are starting relies on the other to be started before it should be started itself. An example of this might be a database that needs to be started before your application container can link to it. You can tell a container that it depends on another container by using the `dependsOn` method: | |
| Sometimes, a container relies on another container to be ready before it should start itself. An example of this might be a database that needs to be started before your application container can link to it. You can tell a container that it depends on another container by using the `dependsOn` method: |
Contributor
Author
There was a problem hiding this comment.
Thanks! Had some issues with ./gradlew spotlessApply but I think I figured it out.
a556beb to
9fb1221
Compare
bsideup
reviewed
Jul 13, 2022
docs/features/startup_and_waits.md
Outdated
| @@ -1,5 +1,13 @@ | |||
| # Waiting for containers to start or be ready | |||
|
|
|||
| ## Depending on another container | |||
Member
There was a problem hiding this comment.
I think it would make sense to add it to the end of the page, after we talk about the concept of waiting, as otherwise it is a bit too early
bsideup
reviewed
Jul 13, 2022
| public GenericContainer<?> redis = new GenericContainer<>("redis:3.0.2").withExposedPorts(6379); | ||
|
|
||
| @Rule | ||
| public GenericContainer<?> nginx = new GenericContainer<>(DockerImageName.parse("nginx:1.9.4")) |
Member
There was a problem hiding this comment.
Suggested change
| public GenericContainer<?> nginx = new GenericContainer<>(DockerImageName.parse("nginx:1.9.4")) | |
| public GenericContainer<?> nginx = new GenericContainer<>("nginx:1.9.4") |
eddumelendez
approved these changes
Jul 13, 2022
Member
|
thanks for the pr @QuinnBast ! this is now merged in master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds documentation for using the
dependsOnfunction. See here