From 8d412515b707df8f8396bb2d9bfdd2d7bb3eeeb5 Mon Sep 17 00:00:00 2001 From: Nev <54870357+MSNev@users.noreply.github.com> Date: Tue, 3 Feb 2026 13:26:36 -0800 Subject: [PATCH] chore: Stop using httpbin.org for tests --- .../Unit/src/SnippetInitialization.Tests.ts | 8 ++--- .../Unit/src/applicationinsights.e2e.tests.ts | 6 ++-- common/Tests/Framework/src/TestHelper.ts | 2 +- common/config/rush/npm-shrinkwrap.json | 34 +++++++++---------- .../Unit/src/W3CTraceStateDependency.tests.ts | 30 ++++++++-------- .../Tests/Unit/src/ajax.tests.ts | 2 +- .../Tests/Unit/src/Common/Util.tests.ts | 6 ++-- .../src/dataSources/dataSources.ts | 2 +- 8 files changed, 45 insertions(+), 45 deletions(-) diff --git a/AISKU/Tests/Unit/src/SnippetInitialization.Tests.ts b/AISKU/Tests/Unit/src/SnippetInitialization.Tests.ts index ccdb5465d..2812f78d9 100644 --- a/AISKU/Tests/Unit/src/SnippetInitialization.Tests.ts +++ b/AISKU/Tests/Unit/src/SnippetInitialization.Tests.ts @@ -678,7 +678,7 @@ export class SnippetInitializationTests extends AITestClass { () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); const xhr = new XMLHttpRequest(); - xhr.open('GET', 'https://httpbin.org/status/200'); + xhr.open('GET', 'http://localhost:9001/README.md'); xhr.send(); Assert.ok(true); } @@ -694,15 +694,15 @@ export class SnippetInitializationTests extends AITestClass { steps: [ () => { let theSnippet = this._initializeSnippet(snippetCreator(getSnippetConfig(this.sessionPrefix))); - fetch('https://httpbin.org/status/200', { method: 'GET', headers: { 'header': 'value'} }); + fetch('http://localhost:9001/README.md', { method: 'GET', headers: { 'header': 'value'} }); Assert.ok(true, "fetch monitoring is instrumented"); }, () => { - fetch('https://httpbin.org/status/200', { method: 'GET' }); + fetch('http://localhost:9001/README.md', { method: 'GET' }); Assert.ok(true, "fetch monitoring is instrumented"); }, () => { - fetch('https://httpbin.org/status/200'); + fetch('http://localhost:9001/README.md'); Assert.ok(true, "fetch monitoring is instrumented"); } ] diff --git a/AISKU/Tests/Unit/src/applicationinsights.e2e.tests.ts b/AISKU/Tests/Unit/src/applicationinsights.e2e.tests.ts index fc27484c9..384cb2fe7 100644 --- a/AISKU/Tests/Unit/src/applicationinsights.e2e.tests.ts +++ b/AISKU/Tests/Unit/src/applicationinsights.e2e.tests.ts @@ -1666,15 +1666,15 @@ export class ApplicationInsightsTests extends AITestClass { fakeFetchAutoRespond: true, steps: [ () => { - fetch('https://httpbin.org/status/200', { method: 'GET', headers: { 'header': 'value' } }); + fetch('http://localhost:9001/README.md', { method: 'GET', headers: { 'header': 'value' } }); Assert.ok(true, "fetch monitoring is instrumented"); }, () => { - fetch('https://httpbin.org/status/200', { method: 'GET' }); + fetch('http://localhost:9001/README.md', { method: 'GET' }); Assert.ok(true, "fetch monitoring is instrumented"); }, () => { - fetch('https://httpbin.org/status/200'); + fetch('http://localhost:9001/README.md'); Assert.ok(true, "fetch monitoring is instrumented"); } ].concat(this.asserts(3, false, false)) diff --git a/common/Tests/Framework/src/TestHelper.ts b/common/Tests/Framework/src/TestHelper.ts index 8c6c9c778..d590a9b06 100644 --- a/common/Tests/Framework/src/TestHelper.ts +++ b/common/Tests/Framework/src/TestHelper.ts @@ -54,7 +54,7 @@ export class TestHelper { }, app: { sesId: "####" }, user: { locale: "en-US" }, - web: { domain: "localhost" }, + web: { domain: "localhost:9001" }, intweb: { }, utc: { popSample: 100 }, loc: { tz: "-08:00" }, diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index 712810d0f..df3c28540 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -415,9 +415,9 @@ } }, "node_modules/@isaacs/brace-expansion": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", - "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.1.tgz", + "integrity": "sha512-WMz71T1JS624nWj2n2fnYAuPovhv7EUhk69R6i9dsVyzxt5eM3bjwvgk9L+APE1TRscGysAVMANkB0jh0LQZrQ==", "dependencies": { "@isaacs/balanced-match": "^4.0.1" }, @@ -546,9 +546,9 @@ } }, "node_modules/@nevware21/ts-utils": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.12.5.tgz", - "integrity": "sha512-JPQZWPKQJjj7kAftdEZL0XDFfbMgXCGiUAZe0d7EhLC3QlXTlZdSckGqqRIQ2QNl0VTEZyZUvRBw6Ednw089Fw==" + "version": "0.12.6", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.12.6.tgz", + "integrity": "sha512-UsS1hbgr/V/x8dT7hVHvr/PwHzASi8/Itis1+L8ykLiqsUXdfzrB1maL0vMmKbDEJpmGARsoC/7RIswi+n248Q==" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -2217,7 +2217,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2586,9 +2586,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001766", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001766.tgz", - "integrity": "sha512-4C0lfJ0/YPjJQHagaE9x2Elb69CIqEPZeG0anQt9SIvIoOH4a4uaRl73IavyO+0qZh6MDLH//DrXThEYKHkmYA==", + "version": "1.0.30001767", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001767.tgz", + "integrity": "sha512-34+zUAMhSH+r+9eKmYG+k2Rpt8XttfE4yXAjoZvkAPs15xcYQhyBYdalJ65BzivAvGRMViEjy6oKr/S91loekQ==", "funding": [ { "type": "opencollective", @@ -2966,9 +2966,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.5.283", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.283.tgz", - "integrity": "sha512-3vifjt1HgrGW/h76UEeny+adYApveS9dH2h3p57JYzBSXJIKUJAvtmIytDKjcSCt9xHfrNCFJ7gts6vkhuq++w==" + "version": "1.5.286", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.286.tgz", + "integrity": "sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -3719,7 +3719,7 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3971,7 +3971,7 @@ "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5760,7 +5760,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -6968,7 +6968,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", diff --git a/extensions/applicationinsights-dependencies-js/Tests/Unit/src/W3CTraceStateDependency.tests.ts b/extensions/applicationinsights-dependencies-js/Tests/Unit/src/W3CTraceStateDependency.tests.ts index d2dd4fba0..f8c4f9772 100644 --- a/extensions/applicationinsights-dependencies-js/Tests/Unit/src/W3CTraceStateDependency.tests.ts +++ b/extensions/applicationinsights-dependencies-js/Tests/Unit/src/W3CTraceStateDependency.tests.ts @@ -349,7 +349,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { statusText: "Hello", trailer: null, type: "basic", - url: "https://httpbin.org/status/200" + url: "http://localhost:9001/README.md" } as any); }, 0); }); @@ -378,7 +378,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { _ensureTraceStateValue(appInsightsCore); // Use test hook to simulate the correct url location - this._ajax["_currentWindowHost"] = "httpbin.org"; + this._ajax["_currentWindowHost"] = "localhost:9001"; // Setup let headers = new Headers(); @@ -387,7 +387,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { method: 'get', headers: headers }; - const url = 'https://httpbin.org/status/200'; + const url = 'http://localhost:9001/README.md'; // Act Assert.ok(trackSpy.notCalled, "No fetch called yet"); @@ -454,7 +454,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { statusText: "Hello", trailer: null, type: "basic", - url: "https://httpbin.org/status/200" + url: "http://localhost:9001/README.md" } as any); }, 0); }); @@ -486,7 +486,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { _ensureTraceStateValue(appInsightsCore); // Use test hook to simulate the correct url location - this._ajax["_currentWindowHost"] = "httpbin.org"; + this._ajax["_currentWindowHost"] = "localhost:9001"; // Setup let headers = new Headers(); @@ -495,7 +495,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { method: 'get', headers: headers }; - const url = 'https://httpbin.org/status/200'; + const url = 'http://localhost:9001/README.md'; // Act Assert.ok(trackSpy.notCalled, "No fetch called yet"); @@ -561,7 +561,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { statusText: "Hello", trailer: null, type: "basic", - url: "https://httpbin.org/status/200" + url: "http://localhost:9001/README.md" } as any); }, 0); }); @@ -591,7 +591,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { let trackSpy = this.sandbox.spy(appInsightsCore, "track"); // Use test hook to simulate the correct url location - this._ajax["_currentWindowHost"] = "httpbin.org"; + this._ajax["_currentWindowHost"] = "localhost:9001"; // Setup let headers = new Headers(); @@ -600,7 +600,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { method: 'get', headers: headers }; - const url = 'https://httpbin.org/status/200'; + const url = 'http://localhost:9001/README.md'; // Act Assert.ok(trackSpy.notCalled, "No fetch called yet"); @@ -666,7 +666,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { statusText: "Hello", trailer: null, type: "basic", - url: "https://httpbin.org/status/200" + url: "http://localhost:9001/README.md" } as any); }, 0); }); @@ -689,7 +689,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { let trackSpy = this.sandbox.spy(appInsightsCore, "track"); // Use test hook to simulate the correct url location - this._ajax["_currentWindowHost"] = "httpbin.org"; + this._ajax["_currentWindowHost"] = "localhost:9001"; // Setup let headers = new Headers(); @@ -698,7 +698,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { method: 'get', headers: headers }; - const url = 'https://httpbin.org/status/200'; + const url = 'http://localhost:9001/README.md'; // Act Assert.ok(trackSpy.notCalled, "No fetch called yet"); @@ -764,7 +764,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { statusText: "Hello", trailer: null, type: "basic", - url: "https://httpbin.org/status/200" + url: "http://localhost:9001/README.md" } as any); }, 0); }); @@ -787,7 +787,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { let trackSpy = this.sandbox.spy(appInsightsCore, "track"); // Use test hook to simulate the correct url location - this._ajax["_currentWindowHost"] = "httpbin.org"; + this._ajax["_currentWindowHost"] = "localhost:9001"; // Setup let headers = new Headers(); @@ -796,7 +796,7 @@ export class W3CTraceStateDependencyTests extends AITestClass { method: 'get', headers: headers }; - const url = 'https://httpbin.org/status/200'; + const url = 'http://localhost:9001/README.md'; // Act Assert.ok(trackSpy.notCalled, "No fetch called yet"); diff --git a/extensions/applicationinsights-dependencies-js/Tests/Unit/src/ajax.tests.ts b/extensions/applicationinsights-dependencies-js/Tests/Unit/src/ajax.tests.ts index 2714c94b8..5da319d89 100644 --- a/extensions/applicationinsights-dependencies-js/Tests/Unit/src/ajax.tests.ts +++ b/extensions/applicationinsights-dependencies-js/Tests/Unit/src/ajax.tests.ts @@ -1373,7 +1373,7 @@ export class AjaxTests extends AITestClass { }); this._ajax = new AjaxMonitor(); let appInsightsCore = new AppInsightsCore(); - const ExcludeRequestRegex = ["localhost"]; + const ExcludeRequestRegex = ["localhost:9001"]; let coreConfig = { instrumentationKey: "", disableFetchTracking: false, excludeRequestFromAutoTrackingPatterns: ExcludeRequestRegex }; appInsightsCore.initialize(coreConfig, [this._ajax, new TestChannelPlugin()]); // Flush any initial requests made during initialization diff --git a/shared/AppInsightsCore/Tests/Unit/src/Common/Util.tests.ts b/shared/AppInsightsCore/Tests/Unit/src/Common/Util.tests.ts index 7bf27cbc8..4e9769c12 100644 --- a/shared/AppInsightsCore/Tests/Unit/src/Common/Util.tests.ts +++ b/shared/AppInsightsCore/Tests/Unit/src/Common/Util.tests.ts @@ -177,7 +177,7 @@ export class UtilTests extends AITestClass { this.testRegexLists(config, false, "test"); this.testRegexLists(config, true, "portal.azure.com"); this.testRegexLists(config, true, "azure.com"); - this.testRegexLists(config, false, "localhost"); + this.testRegexLists(config, false, "localhost:9001"); this.testRegexLists(config, false, "bing.com"); this.testRegexLists(config, true, "prefix.bing.com"); } @@ -193,7 +193,7 @@ export class UtilTests extends AITestClass { this.testRegexLists(config, false, "test"); this.testRegexLists(config, false, "portal.azure.com"); this.testRegexLists(config, true, "azure.com"); - this.testRegexLists(config, true, "localhost"); + this.testRegexLists(config, true, "localhost:9001"); this.testRegexLists(config, true, "bing.com"); this.testRegexLists(config, true, "prefix.bing.com"); } @@ -210,7 +210,7 @@ export class UtilTests extends AITestClass { this.testRegexLists(config, false, "test"); this.testRegexLists(config, false, "portal.azure.com"); this.testRegexLists(config, true, "azure.com"); - this.testRegexLists(config, false, "localhost"); + this.testRegexLists(config, false, "localhost:9001"); this.testRegexLists(config, false, "bing.com"); this.testRegexLists(config, true, "prefix.bing.com"); this.testRegexLists(config, false, "ignore.microsoft.com"); diff --git a/tools/chrome-debug-extension/src/dataSources/dataSources.ts b/tools/chrome-debug-extension/src/dataSources/dataSources.ts index a637f98d0..71e56c746 100644 --- a/tools/chrome-debug-extension/src/dataSources/dataSources.ts +++ b/tools/chrome-debug-extension/src/dataSources/dataSources.ts @@ -9,7 +9,7 @@ import { NoOpDataSource } from "./noOpDataSource"; export function createDataSource(configuration: IConfiguration): IDataSource { // If on localhost, assume we are doing local testing (e.g. for accessibility issues) and use the NoOpDataSource - if (window.location.host.indexOf("localhost") === 0) { + if (window.location.host.indexOf("localhost:9001") === 0) { return new NoOpDataSource(); }