Skip to content

Commit ec23339

Browse files
committed
docs: clarify Testcontainers environment variable usage with Gradle
- Updated Spring plugin README and user guide to explain how to handle Testcontainers runtime environment variables with the Gradle JVM. - Added examples for using `--no-daemon` or stopping existing Gradle daemons to ensure environment variables are recognized.
1 parent c76c7aa commit ec23339

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

doc/user-guide.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,13 @@ By default, the plugin wires `bigDataTestStart` before `JavaExec` and `Test` tas
15571557
GRADLE_USER_HOME=/data/.gradle ./gradlew bigDataTestRun
15581558
----
15591559

1560+
Testcontainers runtime environment variables, such as `TESTCONTAINERS_RYUK_DISABLED`, must be visible to the Gradle JVM that runs the kit. If a Gradle daemon is already running, a one-off shell prefix might not be visible to that daemon. Use `--no-daemon`, or stop existing daemons before running the task:
1561+
1562+
[source,bash]
1563+
----
1564+
TESTCONTAINERS_RYUK_DISABLED=true GRADLE_USER_HOME=/data/.gradle ./gradlew --no-daemon bigDataTestRun
1565+
----
1566+
15601567
Disable automatic task wiring when you want explicit task dependencies:
15611568

15621569
[source,kotlin]

example/spring-gradle-plugin/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ For manual troubleshooting without starting the Spring app, keep the containers
2222
GRADLE_USER_HOME=/data/.gradle ../../gradlew bigDataTestRun
2323
```
2424

25+
For Testcontainers runtime environment variables, make sure the Gradle JVM sees them. With a reused Gradle daemon, a one-off shell prefix might not be picked up, so use `--no-daemon` or stop existing daemons first:
26+
27+
```bash
28+
TESTCONTAINERS_RYUK_DISABLED=true GRADLE_USER_HOME=/data/.gradle ../../gradlew --no-daemon bigDataTestRun
29+
```
30+
2531
The Gradle plugin starts Kerberos, HDFS, and LocalStack S3 before `bootRunLocal` launches the
2632
Spring JVM, runs the TOML extensions, and injects endpoint/extension output as JVM system
2733
properties and environment variables. The application reads the JVM properties from

0 commit comments

Comments
 (0)