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

Add documentation for DependsOn #5597

Merged
merged 3 commits into from
Jul 13, 2022

Conversation

QuinnBast
Copy link
Contributor

Adds documentation for using the dependsOn function. See here

@QuinnBast QuinnBast requested a review from a team as a code owner July 13, 2022 15:39
@eddumelendez eddumelendez added this to the next milestone Jul 13, 2022
Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

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

thanks for the PR @QuinnBast ! not a native speaker but I made a suggestion on the wording. Please run ./gradlew spotlessApply

@@ -1,5 +1,13 @@
# Waiting for containers to start or be ready

## 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:
Copy link
Member

Choose a reason for hiding this comment

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

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:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Had some issues with ./gradlew spotlessApply but I think I figured it out.

@@ -1,5 +1,13 @@
# Waiting for containers to start or be ready

## Depending on another container
Copy link
Member

Choose a reason for hiding this comment

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

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

public GenericContainer<?> redis = new GenericContainer<>("redis:3.0.2").withExposedPorts(6379);

@Rule
public GenericContainer<?> nginx = new GenericContainer<>(DockerImageName.parse("nginx:1.9.4"))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public GenericContainer<?> nginx = new GenericContainer<>(DockerImageName.parse("nginx:1.9.4"))
public GenericContainer<?> nginx = new GenericContainer<>("nginx:1.9.4")

@eddumelendez eddumelendez merged commit a76a7f5 into testcontainers:master Jul 13, 2022
@eddumelendez
Copy link
Member

thanks for the pr @QuinnBast ! this is now merged in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants