diff --git a/sdk/template/template/recordings/browsers/aad_configurationclient_functional_tests_getconfigurationsetting/recording_supports_tracing.json b/sdk/template/template/recordings/browsers/aad_configurationclient_functional_tests_getconfigurationsetting/recording_supports_tracing.json index f721723386d8..c72f84364b7e 100644 --- a/sdk/template/template/recordings/browsers/aad_configurationclient_functional_tests_getconfigurationsetting/recording_supports_tracing.json +++ b/sdk/template/template/recordings/browsers/aad_configurationclient_functional_tests_getconfigurationsetting/recording_supports_tracing.json @@ -1,4 +1,54 @@ { - "Entries": [], + "Entries": [ + { + "RequestUri": "https://myappconfig.azconfig.io/kv/test-key?api-version=1.0", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/vnd.microsoft.appconfig.kv\u002Bjson, application/json, application/problem\u002Bjson", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/93.0.4577.0 Safari/537.36", + "x-ms-client-request-id": "477ecabd-7ac1-4a1d-8c5f-a744bd51b598", + "x-ms-useragent": "azsdk-js-template/1.0.11-beta.1 core-rest-pipeline/1.5.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Credentials": "true", + "Access-Control-Allow-Origin": "*", + "Access-Control-Expose-Headers": "DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, x-ms-effective-locale, WWW-Authenticate, traceparent, tracestate", + "Connection": "keep-alive", + "Content-Type": "application/vnd.microsoft.appconfig.kv\u002Bjson; charset=utf-8", + "Date": "Thu, 03 Feb 2022 21:14:10 GMT", + "ETag": "\u0022jHnSsNSkboEWJFD7nnfzHgnZjRA\u0022", + "Last-Modified": "Wed, 01 Dec 2021 02:23:41 GMT", + "Server": "openresty/1.17.8.2", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "Sync-Token": "zAJw6V16=NjoxOSM1OTI3NTkz;sn=5927593", + "Transfer-Encoding": "chunked", + "x-ms-correlation-request-id": "f75f69b1-eb8c-4fce-8e87-cf75c0cfab76", + "x-ms-request-id": "f75f69b1-eb8c-4fce-8e87-cf75c0cfab76" + }, + "ResponseBody": { + "etag": "jHnSsNSkboEWJFD7nnfzHgnZjRA", + "key": "test-key", + "label": null, + "content_type": null, + "value": "test-value", + "tags": {}, + "locked": false, + "last_modified": "2021-12-01T02:23:41\u002B00:00" + } + } + ], "Variables": {} } diff --git a/sdk/template/template/test/public/configurationClient.spec.ts b/sdk/template/template/test/public/configurationClient.spec.ts index 06250d4b7d36..46150721aa1b 100644 --- a/sdk/template/template/test/public/configurationClient.spec.ts +++ b/sdk/template/template/test/public/configurationClient.spec.ts @@ -88,6 +88,12 @@ describe("[AAD] ConfigurationClient functional tests", function () { // the `getConfigurationSetting` method is being traced correctly, that the // tracing span is properly parented and closed. it("supports tracing", async () => { + // Playback fails in the browser without the "HeaderlessMatcher" + // + // If-Modified-Since & If-None-Match headers are not present in the recording and the request in playback has these headers + // Proxy tool doesn't treat these headers differently, tries to match them with the headers in the recording, and fails. + // More details here - https://github.com/Azure/azure-sdk-tools/issues/2674 + await recorder.setMatcher("HeaderlessMatcher"); const key = assertEnvironmentVariable("APPCONFIG_TEST_SETTING_KEY"); await assert.supportsTracing( (options) => client.getConfigurationSetting(key, options),