-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add Windows CI testing #1935
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?
Add Windows CI testing #1935
Changes from all commits
ce12734
4893ffa
88493e9
3bb619b
2b3b520
e2e4866
684bddf
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 |
|---|---|---|
|
|
@@ -1740,6 +1740,12 @@ axes: | |
| display_name: "8.0" | ||
| variables: | ||
| VERSION: "8.0" | ||
| # 8.2 is used solely for Windows testing. MongoDB 8.0 binaries are affected by SERVER-116018 on Windows, | ||
| # and the fix is only available starting from 8.2. | ||
| - id: "8.2" | ||
| display_name: "8.2" | ||
| variables: | ||
| VERSION: "8.2" | ||
| - id: "7.0" | ||
| display_name: "7.0" | ||
| variables: | ||
|
|
@@ -1770,6 +1776,9 @@ axes: | |
| - id: "ubuntu" | ||
| display_name: "Ubuntu" | ||
| run_on: "ubuntu2004-small" | ||
| - id: "windows" | ||
| display_name: "Windows" | ||
| run_on: "windows-2022-latest-small" | ||
|
|
||
| - id: "topology" | ||
| display_name: "Topology" | ||
|
|
@@ -2332,7 +2341,7 @@ buildvariants: | |
| # | ||
|
|
||
| - matrix_name: "tests-zlib-compression" | ||
| matrix_spec: { compressor: "zlib", auth: "noauth", ssl: "nossl", jdk: "jdk8", version: "*", topology: "standalone", os: "linux" } | ||
| matrix_spec: { compressor: "zlib", auth: "noauth", ssl: "nossl", jdk: "jdk8", version: [ "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest" ], topology: "standalone", os: "linux" } | ||
| display_name: "${version} ${compressor} ${topology} ${auth} ${ssl} ${jdk} ${os} " | ||
| tags: [ "tests-variant" ] | ||
| tasks: | ||
|
|
@@ -2342,7 +2351,7 @@ buildvariants: | |
| - name: "test-legacy-task" | ||
|
|
||
| - matrix_name: "tests-snappy-compression" | ||
| matrix_spec: { compressor: "snappy", auth: "noauth", ssl: "nossl", jdk: "jdk8", version: "*", topology: "standalone", os: "linux" } | ||
| matrix_spec: { compressor: "snappy", auth: "noauth", ssl: "nossl", jdk: "jdk8", version: [ "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest" ], topology: "standalone", os: "linux" } | ||
| display_name: "${version} ${compressor} ${topology} ${auth} ${ssl} ${jdk} ${os} " | ||
| tags: [ "tests-variant" ] | ||
| tasks: | ||
|
|
@@ -2403,6 +2412,22 @@ buildvariants: | |
| - name: "test-core-task" | ||
| - name: "test-legacy-task" | ||
|
|
||
| - matrix_name: "tests-jdk-secure-windows" | ||
| matrix_spec: { auth: "auth", ssl: "ssl", jdk: "jdk17", | ||
| version: [ "8.2" ], | ||
| topology: "*", os: "windows" } | ||
| display_name: "${os}: ${version} ${topology} ${auth} ${ssl} ${jdk}" | ||
| tags: [ "tests-variant" ] | ||
| tasks: | ||
| - name: "test-sync-task" | ||
| exec_timeout_secs: 7200 | ||
|
Member
Author
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. Tests run longer on |
||
| - name: "test-reactive-task" | ||
| exec_timeout_secs: 7200 | ||
| - name: "test-core-task" | ||
| exec_timeout_secs: 7200 | ||
| - name: "test-legacy-task" | ||
| exec_timeout_secs: 7200 | ||
|
|
||
| - matrix_name: "tests-require-api-version" | ||
| matrix_spec: { api-version: "required", auth: "auth", ssl: "nossl", jdk: [ "jdk21" ], version: [ "5.0", "6.0", "7.0", "8.0", "latest" ], | ||
| topology: "standalone", os: "linux" } | ||
|
|
@@ -2540,6 +2565,15 @@ buildvariants: | |
| tasks: | ||
| - name: "csfle-tests-with-mongocryptd-task" | ||
|
|
||
| - matrix_name: "csfle-tests-with-mongocryptd-windows" | ||
| matrix_spec: { os: "windows", | ||
| version: [ "8.0", "latest" ], | ||
| topology: [ "replicaset" ] } | ||
|
vbabanin marked this conversation as resolved.
|
||
| display_name: "${os} CSFLE with mongocryptd: ${version}" | ||
| tasks: | ||
| - name: "csfle-tests-with-mongocryptd-task" | ||
| exec_timeout_secs: 7200 | ||
|
|
||
| - matrix_name: "socks5-tests" | ||
| matrix_spec: { os: "linux", ssl: [ "nossl", "ssl" ], version: [ "latest" ], topology: [ "replicaset" ], socks-auth: [ "auth", "noauth" ] } | ||
| display_name: "SOCKS5 proxy ${socks-auth} : ${version} ${topology} ${ssl} ${jdk} ${os}" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /* | ||
| * Copyright 2008-present MongoDB, Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.mongodb.internal; | ||
|
|
||
| import com.mongodb.lang.Nullable; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
| import java.util.function.UnaryOperator; | ||
|
|
||
| /** | ||
| * Centralized access to environment variables. All production code should use | ||
| * this class instead of calling {@link System#getenv(String)} directly. | ||
|
vbabanin marked this conversation as resolved.
|
||
| * | ||
| * <p>Tests can override values via {@link #envOverride()}.</p> | ||
| */ | ||
| public final class EnvironmentProvider { | ||
|
Member
Author
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. Why this PR introduces EnvironmentProvider (and consolidates env handling)We previously used a reflection-based test helper in What worked on Linux/macOSProcessEnvironment effectively exposes a single backing map. The reflection helper mutates that map, and What breaks on WindowsThe JDK maintains two maps:
The reflection helper only updated What this PR changesIntroduces EnvironmentProvider to avoid reflection/JDK internals entirely. Production code calls Tests override the provider via EnviromentOverride is |
||
| private static UnaryOperator<String> envLookup = System::getenv; | ||
|
|
||
| private EnvironmentProvider() { | ||
| } | ||
|
|
||
| @Nullable | ||
| public static String getEnv(final String key) { | ||
| return envLookup.apply(key); | ||
| } | ||
|
|
||
| /** Exists only for testing **/ | ||
| public static EnvironmentOverride envOverride() { | ||
| return new EnvironmentOverride(); | ||
| } | ||
|
|
||
| public static final class EnvironmentOverride implements AutoCloseable { | ||
| private final Map<String, String> overrides = new HashMap<>(); | ||
| private final UnaryOperator<String> original; | ||
|
|
||
| private EnvironmentOverride() { | ||
| original = envLookup; | ||
| envLookup = key -> overrides.containsKey(key) | ||
| ? overrides.get(key) | ||
| : original.apply(key); | ||
| } | ||
|
|
||
| public EnvironmentOverride set(final String key, @Nullable final String value) { | ||
| overrides.put(key, value); | ||
| return this; | ||
| } | ||
|
|
||
| @Override | ||
| public void close() { | ||
| envLookup = original; | ||
| } | ||
|
vbabanin marked this conversation as resolved.
|
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.