diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/GitStoreTests.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/GitStoreTests.cs index 96abbca37ef..dd947bf916c 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/GitStoreTests.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/GitStoreTests.cs @@ -611,7 +611,8 @@ public async Task BreadCrumbMaintainsMultipleBreadCrumbs() try { - var assetStore = (await _defaultStore.ParseConfigurationFile(Path.Join(testFolder, target1))).ResolveAssetsStoreLocation(); + var parsedConfiguration = await _defaultStore.ParseConfigurationFile(Path.Join(testFolder, target1)); + var assetStore = parsedConfiguration.ResolveAssetsStoreLocation(parsedConfiguration.RepoRoot); var breadCrumbs = new List(); diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/LoggingTests.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/LoggingTests.cs index 0cd4e10a407..16ec364fc6b 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/LoggingTests.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/LoggingTests.cs @@ -103,25 +103,25 @@ public async Task RecordingHandlerLogsSanitizedRequests() private static void AssertLogs(TestLogger logger) { - Assert.Equal(4, logger.Logs.Count); + Assert.Equal(5, logger.Logs.Count); Assert.Equal( $"URI: [ http://127.0.0.1:5000/admin/addsanitizer]{Environment.NewLine}Headers: " + "[{\"Host\":[\"127.0.0.1:5000\"],\"x-abstraction-identifier\":[\"HeaderRegexSanitizer\"]," + "\"Content-Length\":[\"92\"]}]" + Environment.NewLine, - logger.Logs[0].ToString()); + logger.Logs[1].ToString()); Assert.Equal( "Request Body Content{\"key\":\"Location\",\"value\":\"https://fakeazsdktestaccount.table.core.windows.net/Tables\"}", - logger.Logs[1].ToString()); + logger.Logs[2].ToString()); // sanitizer request body is currently duplicated for each key/value pair Assert.Equal( "Request Body Content{\"key\":\"Location\",\"value\":\"https://fakeazsdktestaccount.table.core.windows.net/Tables\"}", - logger.Logs[2].ToString()); + logger.Logs[3].ToString()); Assert.Equal("URI: [ https://fakeazsdktestaccount.table.core.windows.net/Tables]" + Environment.NewLine + "Headers: [{\"Accept\":[\"application/json;odata=minimalmetadata\"],\"Accept-Encoding\":[\"gzip, deflate\"],\"Authorization\":[\"Sanitized\"],\"Connection\":[\"keep-alive\"]," + "\"Content-Length\":[\"12\"],\"Content-Type\":[\"application/octet-stream\"],\"DataServiceVersion\":[\"3.0\"],\"Date\":[\"Tue, 18 May 2021 23:27:42 GMT\"]," + "\"User-Agent\":[\"azsdk-python-data-tables/12.0.0b7 Python/3.8.6 (Windows-10-10.0.19041-SP0)\"],\"x-ms-client-request-id\":[\"a4c24b7a-b830-11eb-a05e-10e7c6392c5a\"]," + "\"x-ms-date\":[\"Tue, 18 May 2021 23:27:42 GMT\"],\"x-ms-version\":[\"2019-02-02\"]}]" + Environment.NewLine, - logger.Logs[3].ToString()); + logger.Logs[4].ToString()); } private static async Task AddSanitizerAsync(RecordingHandler testRecordingHandler, TestLogger logger) diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/TestHelpers.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/TestHelpers.cs index 7ab242bf91b..651c866c3af 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/TestHelpers.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/TestHelpers.cs @@ -354,7 +354,7 @@ public static void CreateFileWithInitialVersion(string testFolder, string fileNa /// public static void CheckBreadcrumbAgainstAssetsConfig(GitAssetsConfiguration configuration) { - var assetsStorePath = configuration.ResolveAssetsStoreLocation(); + var assetsStorePath = configuration.ResolveAssetsStoreLocation(configuration.RepoRoot); var breadCrumbFile = Path.Join(assetsStorePath.ToString(), "breadcrumb", $"{configuration.AssetRepoShortHash}.breadcrumb"); var targetKey = configuration.AssetsJsonRelativeLocation.ToString(); diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Playback.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Playback.cs index 897f3620d1f..6f83380d50e 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Playback.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Playback.cs @@ -37,7 +37,10 @@ public async Task Start() HttpRequestInteractions.GetBodyKey(body, "x-recording-assets-file", allowNulls: true), _recordingHandler.ContextDirectory); - _logger.LogInformation($"recording: {recordingId ?? "null"}\nbody: {body.ToString()}"); + + var logBody = body == null ? "" : body.ToString(); + + _logger.LogInformation($"recording: {recordingId ?? "null"}\nbody: {logBody}"); if (String.IsNullOrEmpty(file) && !String.IsNullOrEmpty(recordingId)) {