-
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
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 | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,16 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| # Java configurations for evergreen | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| export JDK8="/opt/java/jdk8" | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK11="/opt/java/jdk11" | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK17="/opt/java/jdk17" | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK21="/opt/java/jdk21" | ||||||||||||||||||||||||||||||||||||||||||||
| if [ "Windows_NT" == "$OS" ]; then | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK8="/cygdrive/c/java/jdk8" | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK11="/cygdrive/c/java/jdk11" | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK17="/cygdrive/c/java/jdk17" | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK21="/cygdrive/c/java/jdk21" | ||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK8="/opt/java/jdk8" | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK11="/opt/java/jdk11" | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK17="/opt/java/jdk17" | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK21="/opt/java/jdk21" | ||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||
| # note that `JDK21_GRAALVM` is used in `run-graalvm-native-image-app.sh` | ||||||||||||||||||||||||||||||||||||||||||||
| # by dynamically constructing the variable name | ||||||||||||||||||||||||||||||||||||||||||||
| export JDK21_GRAALVM="/opt/java/jdk21-graalce" | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+8
to
16
|
||||||||||||||||||||||||||||||||||||||||||||
| else | |
| export JDK8="/opt/java/jdk8" | |
| export JDK11="/opt/java/jdk11" | |
| export JDK17="/opt/java/jdk17" | |
| export JDK21="/opt/java/jdk21" | |
| fi | |
| # note that `JDK21_GRAALVM` is used in `run-graalvm-native-image-app.sh` | |
| # by dynamically constructing the variable name | |
| export JDK21_GRAALVM="/opt/java/jdk21-graalce" | |
| # note that `JDK21_GRAALVM` is used in `run-graalvm-native-image-app.sh` | |
| # by dynamically constructing the variable name | |
| export JDK21_GRAALVM="/cygdrive/c/java/jdk21-graalce" | |
| else | |
| export JDK8="/opt/java/jdk8" | |
| export JDK11="/opt/java/jdk11" | |
| export JDK17="/opt/java/jdk17" | |
| export JDK21="/opt/java/jdk21" | |
| # note that `JDK21_GRAALVM` is used in `run-graalvm-native-image-app.sh` | |
| # by dynamically constructing the variable name | |
| export JDK21_GRAALVM="/opt/java/jdk21-graalce" | |
| fi |
| 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 { | ||
| 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.
|
||
| } | ||
| } | ||
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.
The comment above says MongoDB 8.0 binaries are affected on Windows and the fix is only available starting from 8.2, but this Windows CSFLE matrix still schedules
version: [ "8.0", "latest" ]. This looks inconsistent and may cause avoidable Windows CI failures; consider using 8.2 here as well (or clarify why CSFLE is exempt).