Skip to content

Commit 321bdb7

Browse files
authored
Evergreen: fixes - gpg and oidc (#1987)
* Evergreen: limit memory usage for oidc tests * Update the testing-guide * Evergreen: Ensure gpg is available JAVA-6221 JAVA-6187
1 parent 606ed03 commit 321bdb7

6 files changed

Lines changed: 31 additions & 5 deletions

File tree

.agents/references/testing-guide.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ description: Testing frameworks, conventions, and commands for the MongoDB Java
5050

5151
# Scala tests (all versions)
5252
./gradlew scalaCheck
53+
54+
# Custom test JVM heap size (default: 4g)
55+
./gradlew :driver-core:test -PtestMaxHeapSize=1g
5356
```
5457

5558
## Module-Specific Notes

.evergreen/run-fle-on-demand-credential-test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ if ! which java ; then
2020
sudo apt install openjdk-17-jdk -y
2121
fi
2222

23+
if ! which gpg ; then
24+
echo "Installing gpg..."
25+
sudo apt install gnupg -y
26+
fi
27+
2328
export PROVIDER=${PROVIDER}
2429

2530
echo "Running gradle version"

.evergreen/run-mongodb-aws-ecs-test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ if ! which git ; then
3636
apt install git -y
3737
fi
3838

39+
if ! which gpg ; then
40+
echo "Installing gpg..."
41+
sudo apt install gnupg -y
42+
fi
43+
3944
cd src
4045

4146
RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")"

.evergreen/run-mongodb-oidc-test.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ if ! which java ; then
4141
echo "Installed java."
4242
fi
4343

44+
if ! which gpg ; then
45+
echo "Installing gpg..."
46+
sudo apt install gnupg -y
47+
fi
48+
4449
which java
4550
export OIDC_TESTS_ENABLED=true
4651

@@ -49,18 +54,21 @@ TO_REPLACE="mongodb://"
4954
REPLACEMENT="mongodb://$OIDC_ADMIN_USER:$OIDC_ADMIN_PWD@"
5055
ADMIN_URI=${MONGODB_URI/$TO_REPLACE/$REPLACEMENT}
5156

57+
# Limit memory for the containers
58+
GRADLE_EXTRA_VARS="--no-daemon -Dorg.gradle.jvmargs=-Xmx512m -PtestMaxHeapSize=1g"
59+
5260
echo "Running gradle version"
53-
./gradlew -version
61+
./gradlew $GRADLE_EXTRA_VARS -version
5462

5563
echo "Running gradle classes compile for driver-sync and driver-reactive-streams: ${FULL_DESCRIPTION}"
56-
./gradlew --parallel --stacktrace --info \
64+
./gradlew $GRADLE_EXTRA_VARS --parallel --stacktrace --info \
5765
driver-sync:classes driver-reactive-streams:classes
5866

5967
echo "Running OIDC authentication tests against driver-sync: ${FULL_DESCRIPTION}"
60-
./gradlew -Dorg.mongodb.test.uri="$ADMIN_URI" \
68+
./gradlew $GRADLE_EXTRA_VARS -Dorg.mongodb.test.uri="$ADMIN_URI" \
6169
--stacktrace --debug --info \
6270
driver-sync:test --tests OidcAuthenticationProseTests --tests UnifiedAuthTest
6371

6472
echo "Running OIDC authentication tests against driver-reactive-streams: ${FULL_DESCRIPTION}"
65-
./gradlew -Dorg.mongodb.test.uri="$ADMIN_URI" \
73+
./gradlew $GRADLE_EXTRA_VARS -Dorg.mongodb.test.uri="$ADMIN_URI" \
6674
--stacktrace --debug --info driver-reactive-streams:test --tests OidcAuthenticationAsyncProseTests

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,12 @@ local.properties
5959
# per-developer Agent overrides
6060
.AGENTS.md
6161
.claude/settings.local.json
62+
.claude/docs
6263
CLAUDE.local.md
6364

65+
# Eclipse annotation processing
66+
driver-benchmarks/.factorypath
67+
6468
# bin build directories
6569
**/bin
6670

buildSrc/src/main/kotlin/conventions/testing-base.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ plugins {
2929
}
3030

3131
tasks.withType<Test> {
32-
maxHeapSize = "4g"
32+
// Override with -PtestMaxHeapSize=<size> (e.g. "1g", "512m"). Defaults to 4g.
33+
maxHeapSize = findProperty("testMaxHeapSize")?.toString() ?: "4g"
3334
maxParallelForks = 1
3435

3536
useJUnitPlatform()

0 commit comments

Comments
 (0)