-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reap docker-compose networks earlier
For docker-compose instances with custom networks, these need to be reaped after each test as they could potentially define overlapping subnets.
- Loading branch information
1 parent
45fa877
commit 6952122
Showing
5 changed files
with
77 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
21 changes: 21 additions & 0 deletions
21
core/src/test/java/org/testcontainers/junit/DockerComposeV2WithNetworkTest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.testcontainers.junit; | ||
|
||
import java.io.File; | ||
|
||
import org.junit.Rule; | ||
import org.testcontainers.containers.DockerComposeContainer; | ||
|
||
public class DockerComposeV2WithNetworkTest extends BaseDockerComposeTest { | ||
|
||
@Rule | ||
public DockerComposeContainer environment = new DockerComposeContainer(new File("src/test/resources/v2-compose-test-with-network.yml")) | ||
.withExposedService("redis_1", REDIS_PORT); | ||
|
||
@Override | ||
protected DockerComposeContainer getEnvironment() { | ||
return environment; | ||
} | ||
|
||
|
||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: '2' | ||
services: | ||
redis: | ||
image: redis | ||
networks: | ||
- redis-net | ||
|
||
networks: | ||
redis-net: |