Skip to content

Add encryption compatibility tests#695

Open
RyanGarfinkel wants to merge 36 commits into
documentdb:mainfrom
RyanGarfinkel:add-encryption-compatibility-tests
Open

Add encryption compatibility tests#695
RyanGarfinkel wants to merge 36 commits into
documentdb:mainfrom
RyanGarfinkel:add-encryption-compatibility-tests

Conversation

@RyanGarfinkel

@RyanGarfinkel RyanGarfinkel commented Jul 20, 2026

Copy link
Copy Markdown

What does this PR do?

This PR adds additional compatibility tests for the encryption feature: insert, update, delete, find, null/missing values, plaintext type, incorrect type, oversized, and nested values. Originally, there was only one, basic smoke test which only covered basic functionality. The tests were then verified in a MongoDB environment. A fixture was also created to be used by each of the additional tests.

Why was this PR needed?

This PR Closes #537, which required adding additional test coverage to the encryption feature. Initially, this operator only had one smoke test, which tested basic functionality. This PR addresses the issue of missing a more extensive test suite to ensure the encryption feature properly handles CRUD operations, null/missing values, oversized values, nested, and incorrect types of values.

What are the relevant issue numbers?

Closes #537

Screenshots

image Image of tests passing. Command: ```python -m pytest compatibility/tests/system/security/encryption --connection-string "mongodb://localhost:27018/?directConnection=true" --engine-name mongodb -v```

Does this PR meet the acceptance criteria?

  • Tests added for new/changed behavior
  • All tests passing
  • Follows project style guide
  • No breaking changes introduced

@RyanGarfinkel
RyanGarfinkel requested a review from a team as a code owner July 20, 2026 03:41
Copilot AI review requested due to automatic review settings July 20, 2026 03:41
RyanGarfinkel and others added 27 commits July 19, 2026 23:43
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
)

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Co-authored-by: Mitchell Elholm <mitchell-elholm@users.noreply.github.com>
Co-authored-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Aaron Gong <jingyaog@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
PatersonProjects and others added 8 commits July 19, 2026 23:43
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Co-authored-by: PatersonProjects <keldonhoff@gmail.com>
Co-authored-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Co-authored-by: Daniel Frankcom <frankcom@amazon.com>
Co-authored-by: Mitchell Elholm <mitchell-elholm@users.noreply.github.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Co-authored-by: Alina (Xi) Li <Alina.Li@improving.com>
Co-authored-by: Leszek Kurzyna <lkurzyna@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Co-authored-by: Alina (Xi) Li <Alina.Li@improving.com>
Co-authored-by: Leszek Kurzyna <lkurzyna@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Co-authored-by: Mitchell Elholm <elholmit@amazon.com>
Co-authored-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Co-authored-by: Daniel Frankcom <frankcom@amazon.com>
Co-authored-by: Victor Tsang <vitsangp@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
Co-authored-by: Victor [C] Tsang <vitsangp@amazon.com>
Co-authored-by: Mitchell Elholm <mitchell-elholm@users.noreply.github.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
@RyanGarfinkel
RyanGarfinkel force-pushed the add-encryption-compatibility-tests branch from b5a6fa3 to 30546fd Compare July 20, 2026 03:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the compatibility test suite for Queryable Encryption by introducing shared QE-collection fixtures and adding focused tests covering CRUD enforcement, query/aggregation behavior, and edge cases (nested paths, large plaintext values, multi-document inserts). This aligns with Issue #537’s requirement for comprehensive QE compatibility coverage beyond the existing smoke test.

Changes:

  • Added reusable fixtures for creating/dropping Queryable Encryption collections with different encrypted-field shapes.
  • Added CRUD-focused tests validating that plaintext writes to encrypted paths are rejected while missing fields remain acceptable.
  • Added query/aggregation and edge-case tests to ensure raw queries execute normally and that nested/large/multi-doc cases behave consistently.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
documentdb_tests/compatibility/tests/system/security/encryption/utils/qe_collections.py Adds shared fixtures to create QE collections with single, multi-field, and nested encrypted paths.
documentdb_tests/compatibility/tests/system/security/encryption/utils/init.py Ensures the new utils directory is a Python package for imports/fixture re-exporting.
documentdb_tests/compatibility/tests/system/security/encryption/conftest.py Re-exports QE fixtures so all tests in the directory can use them without per-file imports.
documentdb_tests/compatibility/tests/system/security/encryption/test_encryption_crud.py Adds CRUD validation tests ensuring plaintext writes to encrypted paths fail and delete/missing-field behaviors succeed.
documentdb_tests/compatibility/tests/system/security/encryption/test_encryption_query.py Adds tests ensuring raw find/aggregate expressions referencing encrypted fields execute without encryption-specific errors.
documentdb_tests/compatibility/tests/system/security/encryption/test_encryption_edge_cases.py Adds edge-case tests for nested encrypted paths, large plaintext rejection, multi-doc inserts, and explain compatibility.

@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jul 20, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, enhancement
Project fields suggested: Component test-coverage · Priority P2 · Effort L · Status Needs Review
Confidence: 0.90 (mixed)

Reasoning

component from path globs (test-coverage); effort from diff stats (412+0 LOC, 6 files); LLM: Adds expanded compatibility test coverage for the encryption feature (CRUD, null/missing, oversized, nested, incorrect types), closing a tracked issue for insufficient test coverage.

If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add compatibility test for encryption (second pass)

7 participants