-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Improve Netty test variants #1721
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,6 +291,7 @@ functions: | |
export AWS_TEMP_SESSION_TOKEN=$CSFLE_AWS_TEMP_SESSION_TOKEN | ||
export CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} | ||
|
||
ASYNC_TRANSPORT="${ASYNC_TRANSPORT}" NETTY_SSL_PROVIDER="${NETTY_SSL_PROVIDER}" \ | ||
AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" TOPOLOGY="${TOPOLOGY}" \ | ||
COMPRESSOR="${COMPRESSOR}" JAVA_VERSION="${JAVA_VERSION}" REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \ | ||
TESTS="${TESTS}" .evergreen/run-tests.sh | ||
|
@@ -371,18 +372,6 @@ functions: | |
${PREPARE_SHELL} | ||
AUTH="${AUTH}" MONGODB_URI="${MONGODB_URI}" TOPOLOGY="${TOPOLOGY}" COMPRESSOR="${COMPRESSOR}" JAVA_VERSION="${JAVA_VERSION}" .evergreen/run-socket-tests.sh | ||
|
||
"run netty tests": | ||
- command: shell.exec | ||
type: test | ||
params: | ||
working_dir: "src" | ||
script: | | ||
${PREPARE_SHELL} | ||
STREAM_TYPE="netty" AUTH="${AUTH}" SSL="${SSL}" NETTY_SSL_PROVIDER="${NETTY_SSL_PROVIDER}" MONGODB_URI="${MONGODB_URI}" \ | ||
TOPOLOGY="${TOPOLOGY}" COMPRESSOR="${COMPRESSOR}" JAVA_VERSION="${JAVA_VERSION}" \ | ||
AZUREKMS_KEY_VAULT_ENDPOINT=${testazurekms_keyvaultendpoint} AZUREKMS_KEY_NAME=${testazurekms_keyname} \ | ||
.evergreen/run-tests.sh | ||
|
||
"run plain auth test": | ||
- command: shell.exec | ||
type: test | ||
|
@@ -1545,11 +1534,6 @@ tasks: | |
- func: "bootstrap mongo-orchestration" | ||
- func: "run socket tests" | ||
|
||
- name: "netty-test" | ||
commands: | ||
- func: "bootstrap mongo-orchestration" | ||
- func: "run netty tests" | ||
|
||
- name: publish-snapshot | ||
depends_on: | ||
- variant: "static-checks" | ||
|
@@ -1835,6 +1819,13 @@ axes: | |
display_name: NoSSL | ||
variables: | ||
SSL: "nossl" | ||
- id: async_transport | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the only way I could figure out how to set a variable. It's not possible afaik to set it directly on the matrix definition. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems good enough |
||
display_name: Async Transport | ||
values: | ||
- id: "netty" | ||
display_name: Netty | ||
variables: | ||
ASYNC_TRANSPORT: "netty" | ||
- id: netty-ssl-provider | ||
display_name: Netty TLS/SSL protocol provider | ||
values: | ||
|
@@ -2274,18 +2265,22 @@ buildvariants: | |
- name: "socket-test" | ||
|
||
- matrix_name: "tests-netty" | ||
matrix_spec: { auth: "noauth", ssl: "*", jdk: "jdk8", version: ["7.0"], topology: "replicaset", os: "linux" } | ||
matrix_spec: { auth: "noauth", ssl: "*", jdk: "jdk8", version: ["7.0"], topology: "replicaset", os: "linux", | ||
async_transport: "netty" } | ||
display_name: "Netty: ${version} ${topology} ${ssl} ${auth} ${jdk} ${os} " | ||
tags: ["tests-netty-variant"] | ||
tasks: | ||
- name: "netty-test" | ||
- name: "test-reactive" | ||
- name: "test-core" | ||
|
||
- matrix_name: "tests-netty-ssl-provider" | ||
matrix_spec: { netty-ssl-provider: "*", auth: "auth", ssl: "ssl", jdk: "jdk8", version: ["7.0"], topology: "replicaset", os: "linux" } | ||
matrix_spec: { auth: "auth", ssl: "ssl", jdk: "jdk8", version: ["7.0"], topology: "replicaset", os: "linux", | ||
async_transport: "netty", netty-ssl-provider: "*" } | ||
display_name: "Netty SSL provider: ${version} ${topology} ${ssl} SslProvider.${netty-ssl-provider} ${auth} ${jdk} ${os} " | ||
tags: ["tests-netty-variant"] | ||
tasks: | ||
- name: "netty-test" | ||
- name: "test-reactive" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spilt into the two tasks to make it run faster, as has already been done for the main test matrix. Core and reactive are the only two modules that pay attention to the transport settings. |
||
- name: "test-core" | ||
|
||
- matrix_name: "tests-socket-snappy-compression" | ||
matrix_spec: { compressor : "snappy", auth: "noauth", ssl: "nossl", jdk: "jdk8", version: ["4.2"], topology: "standalone", os: "linux" } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,12 @@ set -o errexit # Exit the script with error if any of the commands fail | |
# Supported/used environment variables: | ||
# AUTH Set to enable authentication. Values are: "auth" / "noauth" (default) | ||
# SSL Set to enable SSL. Values are "ssl" / "nossl" (default) | ||
# NETTY_SSL_PROVIDER The Netty TLS/SSL protocol provider. Ignored unless SSL is "ssl" and STREAM_TYPE is "netty". Values are "JDK", "OPENSSL", null (a.k.a. "" or '') (default). | ||
# NETTY_SSL_PROVIDER The Netty TLS/SSL protocol provider. Ignored unless SSL is "ssl" and ASYNC_TRANSPORT is "netty". Values are "JDK", "OPENSSL", null (a.k.a. "" or '') (default). | ||
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info) | ||
# TOPOLOGY Allows you to modify variables and the MONGODB_URI based on test topology | ||
# Supported values: "server", "replica_set", "sharded_cluster" | ||
# COMPRESSOR Set to enable compression. Values are "snappy" and "zlib" (default is no compression) | ||
# STREAM_TYPE Set the stream type. Values are "nio2" or "netty". Defaults to "nio2". | ||
# ASYNC_TRANSPORT Set the async transport. Values are "nio2" or "netty". | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed the name to match the new TransportSettings class introduced in 5.0 |
||
# JDK Set the version of java to be used. Java versions can be set from the java toolchain /opt/java | ||
# SLOW_TESTS_ONLY Set to true to only run the slow tests | ||
# AWS_ACCESS_KEY_ID The AWS access key identifier for client-side encryption | ||
|
@@ -34,13 +34,14 @@ SSL=${SSL:-nossl} | |
MONGODB_URI=${MONGODB_URI:-} | ||
TOPOLOGY=${TOPOLOGY:-server} | ||
COMPRESSOR=${COMPRESSOR:-} | ||
STREAM_TYPE=${STREAM_TYPE:-nio2} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to default it since it's already defaulted in |
||
TESTS=${TESTS:-test} | ||
SLOW_TESTS_ONLY=${SLOW_TESTS_ONLY:-false} | ||
|
||
export ASYNC_TYPE="-Dorg.mongodb.test.async.type=${STREAM_TYPE}" | ||
if [ "${ASYNC_TRANSPORT}" != "" ]; then | ||
readonly JAVA_SYSPROP_ASYNC_TRANSPORT="-Dorg.mongodb.test.async.transport=${ASYNC_TRANSPORT}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. match the style just below for |
||
fi | ||
|
||
if [ "${SSL}" = "ssl" ] && [ "${STREAM_TYPE}" = "netty" ] && [ "${NETTY_SSL_PROVIDER}" != "" ]; then | ||
if [ "${SSL}" = "ssl" ] && [ "${ASYNC_TRANSPORT}" = "netty" ] && [ "${NETTY_SSL_PROVIDER}" != "" ]; then | ||
jyemin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
readonly JAVA_SYSPROP_NETTY_SSL_PROVIDER="-Dorg.mongodb.test.netty.ssl.provider=${NETTY_SSL_PROVIDER}" | ||
fi | ||
|
||
|
@@ -128,7 +129,7 @@ echo "Running tests with Java ${JAVA_VERSION}" | |
./gradlew -version | ||
|
||
./gradlew -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} \ | ||
${MULTI_MONGOS_URI_SYSTEM_PROPERTY} ${API_VERSION} ${GRADLE_EXTRA_VARS} ${ASYNC_TYPE} \ | ||
${JAVA_SYSPROP_NETTY_SSL_PROVIDER} \ | ||
${MULTI_MONGOS_URI_SYSTEM_PROPERTY} ${API_VERSION} ${GRADLE_EXTRA_VARS} \ | ||
${JAVA_SYSPROP_ASYNC_TRANSPORT} ${JAVA_SYSPROP_NETTY_SSL_PROVIDER} \ | ||
-Dorg.mongodb.test.fle.on.demand.credential.test.failure.enabled=true \ | ||
--stacktrace --info --continue ${TESTS} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,13 +16,7 @@ | |
|
||
package com.mongodb.reactivestreams.client.unified; | ||
|
||
import com.mongodb.ClusterFixture; | ||
import com.mongodb.MongoClientSettings; | ||
import com.mongodb.client.MongoClient; | ||
import com.mongodb.connection.TransportSettings; | ||
import com.mongodb.lang.Nullable; | ||
import com.mongodb.reactivestreams.client.MongoClients; | ||
import com.mongodb.reactivestreams.client.syncadapter.SyncMongoClient; | ||
import org.bson.BsonArray; | ||
import org.bson.BsonDocument; | ||
import org.junit.jupiter.api.AfterEach; | ||
|
@@ -138,13 +132,6 @@ public void shouldPassAllOutcomes( | |
} | ||
assertNoDroppedError(format("%s passed but there was a dropped error; `onError` called with no handler.", testDescription)); | ||
} | ||
@Override | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Push this down to the base class for all reactive tests. |
||
protected MongoClient createMongoClient(final MongoClientSettings settings) { | ||
TransportSettings overriddenTransportSettings = ClusterFixture.getOverriddenTransportSettings(); | ||
MongoClientSettings clientSettings = overriddenTransportSettings == null ? settings | ||
: MongoClientSettings.builder(settings).transportSettings(overriddenTransportSettings).build(); | ||
return new SyncMongoClient(MongoClients.create(clientSettings)); | ||
} | ||
|
||
@AfterEach | ||
public void cleanUp() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add support for the Netty variants in the main "run tests" function and remove the "run netty tests" function below.