Skip to content

PYTHON-4112 Revert to testing with pymongocrypt@master #1492

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

Merged
merged 4 commits into from
Jan 31, 2024

Conversation

ShaneHarvey
Copy link
Member

Fixes these failures:

 [2024/01/30 13:28:18.641] test/unified_format.py:1722: in run_scenario
 [2024/01/30 13:28:18.641]     self._run_scenario(spec, uri)
 [2024/01/30 13:28:18.641] test/unified_format.py:1747: in _run_scenario
 [2024/01/30 13:28:18.641]     self.run_operations(spec["operations"])
 [2024/01/30 13:28:18.641] test/unified_format.py:1656: in run_operations
 [2024/01/30 13:28:18.641]     self.run_entity_operation(op)
 [2024/01/30 13:28:18.641] test/unified_format.py:1398: in run_entity_operation
 [2024/01/30 13:28:18.641]     result = cmd(**dict(arguments))
 [2024/01/30 13:28:18.641] /opt/python/pypy3.10/lib/pypy3.10/functools.py:303: in __call__
 [2024/01/30 13:28:18.641]     return self.func(*self.args, *args, **keywords)
 [2024/01/30 13:28:18.641] test/unified_format.py:1278: in _clientEncryptionOperation_createDataKey
 [2024/01/30 13:28:18.641]     return target.create_data_key(*args, **kwargs)
 [2024/01/30 13:28:18.641] pymongo/encryption.py:747: in create_data_key
 [2024/01/30 13:28:18.641]     with _wrap_encryption_errors():
 [2024/01/30 13:28:18.641] /opt/python/pypy3.10/lib/pypy3.10/contextlib.py:153: in __exit__
 [2024/01/30 13:28:18.641]     self.gen.throw(typ, value, traceback)
 [2024/01/30 13:28:18.641] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 [2024/01/30 13:28:18.641]     @contextlib.contextmanager
 [2024/01/30 13:28:18.641]     def _wrap_encryption_errors() -> Iterator[None]:
 [2024/01/30 13:28:18.641]         """Context manager to wrap encryption related errors."""
 [2024/01/30 13:28:18.641]         try:
 [2024/01/30 13:28:18.641]             yield
 [2024/01/30 13:28:18.641]         except BSONError:
 [2024/01/30 13:28:18.641]             # BSON encoding/decoding errors are unrelated to encryption so
 [2024/01/30 13:28:18.641]             # we should propagate them unchanged.
 [2024/01/30 13:28:18.641]             raise
 [2024/01/30 13:28:18.641]         except Exception as exc:
 [2024/01/30 13:28:18.641] >           raise EncryptionError(exc) from exc
 [2024/01/30 13:28:18.642] E           pymongo.errors.EncryptionError: unknown kms_provider: aws:name1
 [2024/01/30 13:28:18.642] pymongo/encryption.py:104: EncryptionError
 [2024/01/30 13:28:18.642] _ TestUnifiedNamedKMSCreateDataKey.test_create_datakey_with_named_Azure_KMS_provider _
 [2024/01/30 13:28:18.642]     @contextlib.contextmanager
 [2024/01/30 13:28:18.642]     def _wrap_encryption_errors() -> Iterator[None]:
 [2024/01/30 13:28:18.642]         """Context manager to wrap encryption related errors."""
 [2024/01/30 13:28:18.642]         try:
 [2024/01/30 13:28:18.642] >           yield
 [2024/01/30 13:28:18.642] pymongo/encryption.py:98:

https://spruce.mongodb.com/task/mongo_python_driver_tests_python_version_rhel8_test_encryption__platform~rhel8_auth_ssl~noauth_nossl_python_version~3.7_encryption~encryption_test_4.2_replica_set_0615df47b5251dc718ef91b24da3efb95d7b4f6f_24_01_30_20_00_24?execution=0&sortBy=STATUS&sortDir=ASC

@ShaneHarvey ShaneHarvey requested a review from blink1073 January 30, 2024 21:39
@ShaneHarvey ShaneHarvey requested a review from a team as a code owner January 30, 2024 21:39
@@ -136,6 +136,10 @@ if [ -n "$TEST_ENCRYPTION" ] || [ -n "$TEST_FLE_AZURE_AUTO" ] || [ -n "$TEST_FLE
exit 1
fi
export PYMONGOCRYPT_LIB

# TODO: Test with 'pip install pymongocrypt'
git clone https://github.com/mongodb/libmongocrypt.git libmongocrypt_git
Copy link
Member

Choose a reason for hiding this comment

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

What I originally had in #1477 that we removed was:

if [ ! -d "libmongocrypt_git" ]; then
	git clone https://github.com/mongodb/libmongocrypt.git libmongocrypt_git
fi

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you want me to add that back?

Copy link
Member

Choose a reason for hiding this comment

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

Yes please, it errors on subsequent runs otherwise.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ShaneHarvey ShaneHarvey merged commit 55f12c6 into mongodb:master Jan 31, 2024
@ShaneHarvey ShaneHarvey deleted the PYTHON-4112 branch February 1, 2024 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants