Skip to content

Commit

Permalink
Resolve a number of small test issues with Core, Key Vault (#27311)
Browse files Browse the repository at this point in the history
* Normalize LinkBase for Azure.Core shared files

* Revert changes for Azure/azure-sdk-tools#2434

* Compare recorded bodies

Seems in the course of creating predictable results, I inadvertently fixed #11634.

* Don't enumerate JsonPathSanitizers twice

Fixes #27310
  • Loading branch information
heaths authored Mar 2, 2022
1 parent 6d3aed1 commit 07b03d3
Show file tree
Hide file tree
Showing 12 changed files with 156 additions and 196 deletions.
5 changes: 0 additions & 5 deletions sdk/core/Azure.Core.TestFramework/src/TestRecording.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ await _proxy.Client.AddHeaderSanitizerAsync(
RecordingId);
}

foreach (string jsonPath in _recordedTestBase.JsonPathSanitizers)
{
await _proxy.Client.AddBodyKeySanitizerAsync(new BodyKeySanitizer(Sanitized) { JsonPath = jsonPath }, RecordingId);
}

foreach (UriRegexSanitizer sanitizer in _recordedTestBase.UriRegexSanitizers)
{
await _proxy.Client.AddUriSanitizerAsync(sanitizer, RecordingId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(AzureCoreSharedSources)AppContextSwitchHelper.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)AppContextSwitchHelper.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)Argument.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)AuthorizationChallengeParser.cs" LinkBase="Shared\Core" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(AzureCoreSharedSources)AppContextSwitchHelper.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)AzureEventSource.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)Argument.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)ClientDiagnostics.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)HttpMessageSanitizer.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)ContentTypeUtilities.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)DiagnosticScope.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)PageResponseEnumerator.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)DiagnosticScopeFactory.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)TaskExtensions.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)LightweightPkcs8Decoder.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)PemReader.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)AppContextSwitchHelper.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)AzureEventSource.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)Argument.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)ClientDiagnostics.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)HttpMessageSanitizer.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)ContentTypeUtilities.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)DiagnosticScope.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)PageResponseEnumerator.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)DiagnosticScopeFactory.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)TaskExtensions.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)LightweightPkcs8Decoder.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)PemReader.cs" LinkBase="Shared\Core" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public partial class CertificateClientLiveTests : CertificatesTestBase
public CertificateClientLiveTests(bool isAsync, CertificateClientOptions.ServiceVersion serviceVersion)
: base(isAsync, serviceVersion, null /* RecordedTestMode.Record /* to re-record */)
{
// TODO: https://github.com/Azure/azure-sdk-for-net/issues/11634
CompareBodies = false;
}

[SetUp]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
</ItemGroup>

<ItemGroup>
<Compile Include="$(AzureCoreSharedSources)AppContextSwitchHelper.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)AzureEventSource.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)ClientDiagnostics.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)HttpMessageSanitizer.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)ContentTypeUtilities.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)DiagnosticScope.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)PageResponseEnumerator.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)DiagnosticScopeFactory.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)TaskExtensions.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)AppContextSwitchHelper.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)AzureEventSource.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)ClientDiagnostics.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)HttpMessageSanitizer.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)ContentTypeUtilities.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)DiagnosticScope.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)PageResponseEnumerator.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)DiagnosticScopeFactory.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)TaskExtensions.cs" LinkBase="Shared\Core" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ protected CryptographyClientLiveTests(bool isAsync, KeyClientOptions.ServiceVers
: base(isAsync, serviceVersion, mode)
{
_serviceVersion = serviceVersion;

// TODO: https://github.com/Azure/azure-sdk-for-net/issues/11634
CompareBodies = false;
}

[Test]
Expand Down Expand Up @@ -169,7 +166,7 @@ public async Task SignVerifyDataStreamRoundTrip([EnumValues]SignatureAlgorithm a
Assert.AreEqual(key.Id, verifyDataResult.KeyId);

Assert.True(verifyResult.IsValid);
Assert.True(verifyResult.IsValid);
Assert.True(verifyDataResult.IsValid);
}

// We do not test using ES256K below since macOS doesn't support it; various ideas to work around that adversely affect runtime code too much.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ protected KeyClientLiveTests(bool isAsync, KeyClientOptions.ServiceVersion servi
: base(isAsync, serviceVersion, mode)
{
_serviceVersion = serviceVersion;

// TODO: https://github.com/Azure/azure-sdk-for-net/issues/11634
CompareBodies = false;
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public KeyResolverLiveTests(bool isAsync, KeyClientOptions.ServiceVersion servic
: base(isAsync, serviceVersion, null /* RecordedTestMode.Record /* to re-record */)
{
_serviceVersion = serviceVersion;
// TODO: https://github.com/Azure/azure-sdk-for-net/issues/11634
CompareBodies = false;
}

public KeyResolver Resolver { get { return GetResolver(); } }
Expand Down
Loading

0 comments on commit 07b03d3

Please sign in to comment.