Skip to content
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

Test Fix and single test run command #228

Conversation

Wraith2
Copy link
Contributor

@Wraith2 Wraith2 commented Sep 27, 2019

The test TestKeysFromCertificatesCreatedWithMultipleCryptoProviders was failing because it was trying to cast an RSACng private key into an RSACryptoServiceProvider and that isn't possible. The test is attempting to verify that csp providers roundtrip properly so it isn't designed to cope with Cng keys.

I've changed the certificate path fetch logic to return null for non-csp private keys without crashing and added a check on the path so the loop skips to the next item if the path is null. This effectively skips the cng provider(s).

I also updated two tests to make sure that if a certificate file is generated it will be cleaned up even if the test fails. This stops certificates being added to the store and never removed. I had quite a few in there.

Test Microsoft.Data.SqlClient.ManualTesting.Tests.AlwaysEncrypted.CspProviderExt.TestRoundTripWithCSPAndCertStoreProvider is marked as [Fact(Skip = "Failing in TCE")] what is tce? It's the other place that uses the get csp path function.

I added the run command needed for running a specific command in case it's help for anyone else trying to debug single tests in future.

ensure that cleanup of certificates happens if one is created
add single test run command to buildguide
Copy link
Contributor

@David-Engel David-Engel left a comment

Choose a reason for hiding this comment

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

LGTM

@David-Engel
Copy link
Contributor

what is tce?

Token Controlled Encryption

@cheenamalhotra cheenamalhotra added this to the 1.1.0-preview1 milestone Sep 27, 2019
@cheenamalhotra cheenamalhotra merged commit 197d47b into dotnet:master Sep 27, 2019
@Wraith2 Wraith2 deleted the fix-TestKeysFromCertificatesCreatedWithMultipleCryptoProviders branch September 27, 2019 18:06
yukiwongky pushed a commit to yukiwongky/SqlClient that referenced this pull request Nov 5, 2019
ensure that cleanup of certificates happens if one is created
add single test run command to buildguide
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.

3 participants