Skip to content

Commit 9779e80

Browse files
authored
Merge branch 'main' into gh-11489
2 parents 5f1ebf1 + 7fe356e commit 9779e80

22 files changed

Lines changed: 87 additions & 63 deletions

File tree

.github/pull_request_template.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!--
2-
Thanks for contributing to Testcontainers. Please review the following notes before
3-
submitting a pull request.
2+
Thanks for contributing to Testcontainers. Before submitting a pull request, please
3+
review our contributing guidelines at https://java.testcontainers.org/contributing/
4+
5+
Please also review the following notes before submitting a pull request.
46
57
New Modules:
68

core/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ task jarFileTest(type: Test) {
3434
testClassesDirs = sourceSets.jarFileTest.output.classesDirs
3535
classpath = sourceSets.jarFileTest.runtimeClasspath
3636

37-
file(shadowJar.outputs.files.singleFile) // input for correct caching
38-
systemProperty("jarFile", shadowJar.outputs.files.singleFile)
37+
inputs.files(shadowJar).withPathSensitivity(PathSensitivity.RELATIVE)
38+
systemProperty("jarFile", project.projectDir.toPath().relativize(shadowJar.outputs.files.singleFile.toPath()).toString())
3939

4040
dependsOn(shadowJar)
4141
}
@@ -80,8 +80,8 @@ dependencies {
8080

8181
shaded 'org.awaitility:awaitility:4.3.0'
8282

83-
api platform('com.github.docker-java:docker-java-bom:3.7.0')
84-
shaded platform('com.github.docker-java:docker-java-bom:3.7.0')
83+
api platform('com.github.docker-java:docker-java-bom:3.7.1')
84+
shaded platform('com.github.docker-java:docker-java-bom:3.7.1')
8585

8686
api "com.github.docker-java:docker-java-api"
8787

core/src/main/java/org/testcontainers/containers/DockerModelRunnerContainer.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,20 @@ public DockerModelRunnerContainer withModel(String model) {
7979
return this;
8080
}
8181

82+
/**
83+
* Returns the base endpoint URL for the Docker Model Runner service.
84+
*
85+
* @return the base URL in the format {@code http://<host>:<port>}
86+
*/
8287
public String getBaseEndpoint() {
8388
return "http://" + getHost() + ":" + getMappedPort(PORT);
8489
}
8590

91+
/**
92+
* Returns the OpenAI-compatible API endpoint URL for the Docker Model Runner service.
93+
*
94+
* @return the OpenAI-compatible endpoint URL in the format {@code http://<host>:<port>/engines}
95+
*/
8696
public String getOpenAIEndpoint() {
8797
return getBaseEndpoint() + "/engines";
8898
}

core/src/test/java/org/testcontainers/junit/ComposeContainerVolumeRemovalTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.testcontainers.junit;
22

3+
import org.junit.jupiter.api.Disabled;
34
import org.junit.jupiter.params.ParameterizedTest;
45
import org.junit.jupiter.params.provider.Arguments;
56
import org.junit.jupiter.params.provider.MethodSource;
@@ -16,6 +17,7 @@
1617
import static org.assertj.core.api.Assertions.assertThat;
1718
import static org.awaitility.Awaitility.await;
1819

20+
@Disabled
1921
class ComposeContainerVolumeRemovalTest {
2022

2123
public static Stream<Arguments> params() {

core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategies.java renamed to core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategiesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import static org.assertj.core.api.Assertions.assertThat;
1212

13-
class ComposeContainerWithWaitStrategies {
13+
class ComposeContainerWithWaitStrategiesTest {
1414

1515
private static final int REDIS_PORT = 6379;
1616

core/src/test/java/org/testcontainers/junit/DockerComposeContainerVolumeRemovalTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.testcontainers.junit;
22

3+
import org.junit.jupiter.api.Disabled;
34
import org.junit.jupiter.params.ParameterizedTest;
45
import org.junit.jupiter.params.provider.MethodSource;
56
import org.testcontainers.DockerClientFactory;
@@ -15,6 +16,7 @@
1516
import static org.assertj.core.api.Assertions.assertThat;
1617
import static org.awaitility.Awaitility.await;
1718

19+
@Disabled
1820
class DockerComposeContainerVolumeRemovalTest {
1921

2022
public static Object[][] params() {

docs/modules/docker_compose.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ accessible via the static factory methods from of the `Wait` class.
7272

7373
For instance, we can wait for exposed port and set a custom timeout:
7474
<!--codeinclude-->
75-
[Wait for the exposed port and use a custom timeout](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategies.java) inside_block:composeContainerWaitForPortWithTimeout
75+
[Wait for the exposed port and use a custom timeout](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategiesTest.java) inside_block:composeContainerWaitForPortWithTimeout
7676
<!--/codeinclude-->
7777

7878
Needless to say, we can define different strategies for each service in our Docker Compose setup.
@@ -81,7 +81,7 @@ For example, our Redis container can wait for a successful redis-cli command,
8181
while our db service waits for a specific log message:
8282

8383
<!--codeinclude-->
84-
[Wait for a custom command and a log message](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategies.java) inside_block:composeContainerWithCombinedWaitStrategies
84+
[Wait for a custom command and a log message](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategiesTest.java) inside_block:composeContainerWithCombinedWaitStrategies
8585
<!--/codeinclude-->
8686

8787

docs/modules/k6.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,23 @@ Testcontainers module for [k6](https://registry.hub.docker.com/r/grafana/k6).
1111

1212
## Basic script execution
1313

14-
Execute a simple k6 test script, `test.js`, with commandline options and injected script variable.
14+
You can start a K6 container instance from any Java application by using:
15+
16+
<!--codeinclude-->
17+
[Setup the container](../../modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java) inside_block:standard_k6
18+
<!--/codeinclude-->
19+
20+
The test above uses a simple k6 script, `test.js`, with command line options and an injected script variable.
21+
22+
Once the container is started, you can wait for the test results to be collected:
23+
24+
<!--codeinclude-->
25+
[Wait for test results](../../modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java) inside_block:wait
26+
<!--/codeinclude-->
1527

1628
Create a simple k6 test script to be executed as part of your tests:
1729

1830
<!--codeinclude-->
19-
[Setup the container](../../modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java) inside_block:standard_k6
2031
[Content of `scripts/test.js`](../../modules/k6/src/test/resources/scripts/test.js) inside_block:access_script_vars
2132
<!--/codeinclude-->
2233

docs/modules/localstack.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,21 @@ You can start a LocalStack container instance from any Java application by using
1010
[Container creation](../../modules/localstack/src/test/java/org/testcontainers/localstack/LocalStackContainerTest.java) inside_block:container
1111
<!--/codeinclude-->
1212

13+
Environment variables listed in the [LocalStack configuration documentation](https://docs.localstack.cloud/references/configuration/) may be used to customize LocalStack's configuration.
14+
Use the `.withEnv(key, value)` method on `LocalStackContainer` to apply configuration settings.
15+
16+
!!! note
17+
Starting March 23, 2026, `localstack/localstack` requires authentication via a `LOCALSTACK_AUTH_TOKEN` environment variable. Without it, the container will fail to start.
18+
19+
Use `.withEnv("LOCALSTACK_AUTH_TOKEN", System.getenv("LOCALSTACK_AUTH_TOKEN"))` to pass the token.
20+
See the [LocalStack blog post](https://blog.localstack.cloud/localstack-single-image-next-steps/) for more details.
21+
1322
## Creating a client using AWS SDK
1423

1524
<!--codeinclude-->
1625
[AWS SDK V2](../../modules/localstack/src/test/java/org/testcontainers/localstack/LocalStackContainerTest.java) inside_block:with_aws_sdk_v2
1726
<!--/codeinclude-->
1827

19-
Environment variables listed in [Localstack's README](https://github.com/localstack/localstack#configurations) may be used to customize Localstack's configuration.
20-
Use the `.withEnv(key, value)` method on `LocalStackContainer` to apply configuration settings.
21-
2228
## Adding this module to your project dependencies
2329

2430
Add the following dependency to your `pom.xml`/`build.gradle` file:

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ org.gradle.caching=true
33
org.gradle.configureondemand=true
44
org.gradle.jvmargs=-Xmx2g
55

6-
testcontainers.version=2.0.2
6+
testcontainers.version=2.0.4

0 commit comments

Comments
 (0)