Add Windows CI testing#1935
Draft
vbabanin wants to merge 5 commits intomongodb:mainfrom
Draft
Conversation
- Add Windows 2022 Evergreen build variants for server 8.2 across all topologies to enable Windows CI coverage - Add EnvironmentProvider class to centralize all System.getenv() calls, replacing the reflection-based env var override hack that fails on Windows due to JDK's ProcessEnvironment dual-map architecture - Fix SSL keystore/truststore paths in Evergreen scripts to use native Windows paths via cygpath - Fix JSON test file path separator handling and mongocryptd temp directory for Windows compatibility - Skip Unix-domain-socket test on Windows JAVA-6057
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Windows CI coverage and improves Windows compatibility across tests and Evergreen configuration by standardizing environment-variable access and fixing platform-specific path handling.
Changes:
- Add Windows 2022 Evergreen build variants (server 8.2) and Windows-specific path handling in Evergreen scripts.
- Introduce
EnvironmentProviderto centralize env var access and enable test-time overrides without reflection hacks. - Fix Windows compatibility issues in tests (temp dirs, path separators) and skip a non-portable socket test on Windows.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| driver-sync/src/test/functional/com/mongodb/client/AbstractSessionsProseTest.java | Write mongocryptd logs to Java temp dir for cross-platform support. |
| driver-sync/src/test/functional/com/mongodb/client/AbstractMicrometerProseTest.java | Replace reflective env-var mutation with EnvironmentProvider overrides in micrometer prose tests. |
| driver-core/src/test/unit/com/mongodb/internal/EnvironmentProviderTest.java | Add unit tests for env lookup/override behavior. |
| driver-core/src/test/functional/com/mongodb/internal/connection/SocketStreamHelperSpecification.groovy | Skip a socket configuration test on Windows. |
| driver-core/src/test/functional/com/mongodb/internal/connection/FaasEnvironmentAccessor.java | Remove test-only accessor for env overrides (superseded by EnvironmentProvider). |
| driver-core/src/test/functional/com/mongodb/internal/connection/ClientMetadataTest.java | Update .dockerenv path to match production logic and be OS-correct. |
| driver-core/src/test/functional/com/mongodb/client/WithWrapper.java | Switch env-var test wrapper to EnvironmentProvider.envOverride(). |
| driver-core/src/main/com/mongodb/internal/observability/micrometer/TracingManager.java | Use EnvironmentProvider.getEnv for observability env vars. |
| driver-core/src/main/com/mongodb/internal/observability/micrometer/MicrometerTracer.java | Use EnvironmentProvider.getEnv for query text length env var. |
| driver-core/src/main/com/mongodb/internal/EnvironmentProvider.java | New centralized env var provider + override mechanism for tests. |
| driver-core/src/main/com/mongodb/internal/connection/OidcAuthenticator.java | Read OIDC-related env vars via EnvironmentProvider. |
| driver-core/src/main/com/mongodb/internal/connection/FaasEnvironment.java | Delegate env var reads to EnvironmentProvider (removing test override map). |
| driver-core/src/main/com/mongodb/internal/authentication/BuiltInAwsCredentialSupplier.java | Read AWS env vars via EnvironmentProvider. |
| bson/src/test/unit/util/JsonPoweredTestHelper.java | Normalize path separators to reliably locate JSON spec files on Windows. |
| .evergreen/setup-env.bash | Add Windows-specific JDK paths for Evergreen. |
| .evergreen/run-tests.sh | Use native Windows paths for SSL keystore/truststore and log Windows version. |
| .evergreen/run-csfle-tests-with-mongocryptd.sh | Use native Windows paths for SSL keystore/truststore. |
| .evergreen/.evg.yml | Add Windows axes/buildvariants and introduce MongoDB 8.2 for Windows coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# Conflicts: # driver-core/src/main/com/mongodb/internal/observability/micrometer/TracingManager.java # driver-sync/src/test/functional/com/mongodb/client/AbstractMicrometerProseTest.java
Comment on lines
+1743
to
+1748
| # 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes in this PR:
JAVA-6057
Checklist
AI Usage & Effectiveness