Skip to content

CSHARP-4386: Test mongocryptd is not spawned when shared library is loaded. #965

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 5 commits into from
Nov 28, 2022

Conversation

DmitryLukyanov
Copy link
Contributor

@DmitryLukyanov DmitryLukyanov commented Nov 23, 2022

No description provided.

@DmitryLukyanov DmitryLukyanov changed the title CSHARP-4386: Test mongocryptd is not spawned when shared library is l… CSHARP-4386: Test mongocryptd is not spawned when shared library is loaded. Nov 23, 2022
@JamesKovacs JamesKovacs requested review from BorisDog and removed request for JamesKovacs November 23, 2022 22:34
var clientEncryptedSchema = new BsonDocument("db.coll", JsonFileReader.Instance.Documents["external.external-schema.json"]);
var cryptSharedPath = CoreTestConfiguration.GetCryptSharedLibPath();
Ensure.That(File.Exists(cryptSharedPath), $"Shared library path {cryptSharedPath} is not valid.");
var effectiveExtraOptions = new Dictionary<string, object>(extraOptions)
Copy link
Contributor

Choose a reason for hiding this comment

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

Where effectiveExtraOptions is used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, fixed. The test actually behaves almost the same even without this configuration because a shared library is configured by default, but it's definitely better to have it configured explicitly.

};
return ConfigureClientEncrypted(kmsProviderFilter: kmsProvider, schemaMap: clientEncryptedSchema, extraOptions: extraOptions);
}
default: throw new Exception($"Invalid bypass mongocryptd {bypassSpawning} option.");
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: ArgumentOutOfRangeException?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this file, we use Exception in other places. I don't have strong preference in general what exception better to use, but mostly in tests we use just Exception

Copy link
Contributor

@BorisDog BorisDog left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@BorisDog BorisDog left a comment

Choose a reason for hiding this comment

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

LGTM

@DmitryLukyanov DmitryLukyanov merged commit d421549 into mongodb:master Nov 28, 2022
dnickless pushed a commit to dnickless/mongo-csharp-driver that referenced this pull request Aug 24, 2023
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