RUBY-3625 Support auto encryption in unified tests - #3085
Merged
comandeo-mongo merged 3 commits intoJul 30, 2026
Conversation
Sync the poc-queryable-encryption fixture from the specifications repo into the valid-pass unified suite. It exercises autoEncryptOpts on a client entity (local KMS + queryable encryption), demonstrating the runner support landed under RUBY-3773 and RUBY-3363.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Unified Test Format fixture to the Ruby driver’s unified spec test suite to demonstrate and validate support for configuring AutoEncryptionOpts via autoEncryptOpts on a client entity (Queryable Encryption / CSFLE), aligning with DRIVERS-3106 and RUBY-3625.
Changes:
- Syncs the canonical
poc-queryable-encryptionunified test (valid-pass) into the driver’s spec fixtures. - Exercises QE setup via
encryptedFieldscreate options and verifies encrypted vs unencrypted client behavior in basic CRUD operations.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
comandeo-mongo
marked this pull request as draft
July 29, 2026 13:02
The poc-queryable-encryption fixture added to the valid-pass unified suite is gated only by `csfle: true`. Mongo::CRUD::Requirement#satisfied? checked that gate with `!!(ENV['LIBMONGOCRYPT_PATH'] || ENV['FLE'])`, and Evergreen exports FLE="" on every host. An empty string is truthy in Ruby, so the gate always passed and the fixture ran on variants that have no libmongocrypt. Use the same emptiness check that Mrss::LiteConstraints#require_libmongocrypt uses, so the two gates cannot disagree. Also close the cluster when building the encrypter fails with a LoadError. Mongo::Client#initialize only rescued StandardError there, but Mongo::Crypt::Binding raises LoadError, which is a ScriptError. The cluster was therefore left open and its monitoring and connection pool threads outlived the failed constructor, which in turn failed every example in the next spec file that calls clean_slate_for_all_if_possible.
comandeo-mongo
marked this pull request as ready for review
July 30, 2026 08:51
jamis
approved these changes
Jul 30, 2026
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.
Syncs the canonical
poc-queryable-encryptionfixture from the specifications repo into the valid-pass unified suite. It exercisesautoEncryptOptson a client entity (local KMS provider + queryable encryptionencryptedFields), demonstrating that the Unified Test Runner can configureAutoEncryptionOpts— the acceptance criterion of DRIVERS-3106.The runner support itself already exists on master (landed incrementally under RUBY-3773 and RUBY-3363); this fixture is the missing demonstration. No runner code changes are needed —
spec/spec_tests/unified_spec.rbglobsvalid-pass/**/*.ymlautomatically.Files changed
spec/spec_tests/data/unified/valid-pass/poc-queryable-encryption.yml— new fixture, copied verbatim fromspecifications/source/unified-test-format/tests/valid-pass/.Test plan
bundle exec rspec spec/spec_tests/unified_spec.rb -e poc-queryable-encryptionagainst a local 8.2.0 replica set with crypt_shared + libmongocrypt-helper — 1 example, 0 failures.Jira: https://jira.mongodb.org/browse/RUBY-3625