Skip to content

Commit

Permalink
[EngSys] upgrade dev dependency puppeteer to ^22.0.0 (#28200)
Browse files Browse the repository at this point in the history
by running `rush add -m --dev -p puppeteer@^22.0.0`

- adjust core-xml test due puppeteer switched from Chromium to Chrome
- ignore Accept-Language headers for browser playback tests

Resolves #25790
  • Loading branch information
jeremymeng authored Feb 6, 2024
1 parent d0a773e commit 18d6d50
Show file tree
Hide file tree
Showing 33 changed files with 192 additions and 297 deletions.
334 changes: 97 additions & 237 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/core/core-amqp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"karma-mocha": "^2.0.1",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"ts-node": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-sse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.2",
"ts-node": "^10.0.0",
"typescript": "~5.3.3"
Expand Down
36 changes: 12 additions & 24 deletions sdk/core/core-xml/test/xml.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ describe("XML serializer", function () {
// @ts-expect-error - intentional error for test
await parseXML(undefined);
assert.fail("Expected error");
} catch (error: any) {
} catch (err) {
assert.ok(err instanceof Error);
const error = err as Error;
assert.ok(
error.message.indexOf("Document is empty") !== -1 || // Chrome
error.message.includes("Document is empty") || // NodeJS v8
error.message.includes("This page contains the following errors") || // Chrome
(error.message.startsWith("XML Parsing Error: syntax error") &&
error.message.indexOf("undefined") !== -1), // Firefox
error.message.includes("undefined")), // Firefox
`error.message ("${error.message}") should have contained "Document is empty" or "undefined"`,
);
}
Expand All @@ -26,11 +29,14 @@ describe("XML serializer", function () {
// @ts-expect-error - intentional error for test
await parseXML(null);
assert.fail("Expected error");
} catch (error: any) {
} catch (err) {
assert.ok(err instanceof Error);
const error = err as Error;
assert.ok(
error.message.indexOf("Document is empty") !== -1 || // Chrome
error.message.includes("Document is empty") || // NodeJS v8
error.message.includes("This page contains the following errors") || // Chrome
(error.message.startsWith("XML Parsing Error: syntax error") &&
error.message.indexOf("null") !== -1), // Firefox
error.message.includes("null")), // Firefox
`error.message ("${error.message}") should have contained "Document is empty" or "null"`,
);
}
Expand Down Expand Up @@ -442,24 +448,6 @@ describe("XML serializer", function () {
);
});

it("with element with attribute and value", async function () {
const xml = stringifyXML(
{
fruit: {
$: {
healthy: "true",
},
_: "yum",
},
},
{ rootName: "fruits" },
);
assert.deepStrictEqual(
xml,
`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><fruits><fruit healthy="true">yum</fruit></fruits>`,
);
});

it("with element with child empty element", async function () {
const xml = stringifyXML(
{
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"ts-node": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/ts-http-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"karma-sourcemap-loader": "^0.3.8",
"karma": "^6.3.0",
"mocha": "^10.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"typescript": "~5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/event-hubs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"mocha": "^10.0.0",
"moment": "^2.24.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"ts-node": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/identity-broker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"cross-env": "^7.0.2",
"eslint": "^8.0.0",
"mocha": "^10.0.0",
"puppeteer": "^20.5.0",
"puppeteer": "^22.0.0",
"rimraf": "^5.0.1",
"typescript": "~5.3.3",
"sinon": "^17.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/identity-cache-persistence/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"eslint": "^8.0.0",
"inherits": "^2.0.3",
"mocha": "^10.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"typescript": "~5.3.3",
"util": "^0.12.1",
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/identity-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"eslint": "^8.0.0",
"inherits": "^2.0.3",
"mocha": "^10.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"typescript": "~5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"mocha": "^10.0.0",
"ms": "^2.1.3",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"ts-node": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-certificates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"source-map-support": "^0.5.9",
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"esm": "^3.2.18",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"sinon": "^17.0.0",
"source-map-support": "^0.5.9",
"typescript": "~5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-keys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"source-map-support": "^0.5.9",
Expand Down
19 changes: 15 additions & 4 deletions sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { testPollerProperties } from "./utils/recorderUtils";
import { authenticate, envSetupForPlayback } from "./utils/testAuthentication";
import TestClient from "./utils/testClient";
import { stringToUint8Array, uint8ArrayToString } from "./utils/crypto";
import { isBrowser } from "@azure/core-util";

describe("Keys client - create, read, update and delete operations", () => {
const keyPrefix = `CRUD${env.KEY_NAME || "KeyName"}`;
Expand All @@ -30,7 +31,7 @@ describe("Keys client - create, read, update and delete operations", () => {

// These tests rely on the attestation URI inside the Release Policy, which is sanitized by the test recorder.
// Using a bodiless matcher to ignore the differences that this causes.
recorder.setMatcher("BodilessMatcher");
await recorder.setMatcher("BodilessMatcher");
await recorder.start(envSetupForPlayback);

const authentication = await authenticate(getServiceVersion(), recorder);
Expand Down Expand Up @@ -263,7 +264,7 @@ describe("Keys client - create, read, update and delete operations", () => {
"Unexpected key name in result from beginDeleteKey().",
);
await poller.pollUntilDone();
let getResult = await poller.getResult();
let getResult = poller.getResult();
assert.equal(
getResult!.name,
keyName,
Expand Down Expand Up @@ -452,7 +453,12 @@ describe("Keys client - create, read, update and delete operations", () => {
}
});

it("can create an exportable key and release it", async () => {
it("can create an exportable key and release it", async function (this: Context) {
// Recorder sanitizer issue
// https://github.com/Azure/azure-sdk-for-js/issues/28455
if (isPlaybackMode() && isBrowser) {
this.skip();
}
const keyName = recorder.variable(
"exportkey",
`exportkey-${Math.floor(Math.random() * 1000)}`,
Expand Down Expand Up @@ -499,7 +505,12 @@ describe("Keys client - create, read, update and delete operations", () => {
);
});

it("errors when updating an immutable release policy", async () => {
it("errors when updating an immutable release policy", async function (this: Context) {
// Recorder sanitizer issue
// https://github.com/Azure/azure-sdk-for-js/issues/28455
if (isPlaybackMode() && isBrowser) {
this.skip();
}
const keyName = recorder.variable(
"immutablerelease",
`immutablerelease-${Math.floor(Math.random() * 1000)}`,
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-secrets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"source-map-support": "^0.5.9",
Expand Down
2 changes: 1 addition & 1 deletion sdk/notificationhubs/notification-hubs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"karma-mocha-reporter": "^2.2.5",
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^5.0.5",
"ts-node": "^10.9.1",
"typescript": "~5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion sdk/openai/openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.2",
"ts-node": "^10.0.0",
"typescript": "~5.3.3"
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"moment": "^2.24.0",
"c8": "^8.0.0",
"promise": "^8.0.3",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"ts-node": "^10.0.0",
"typescript": "~5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-blob-changefeed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
"ts-node": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-blob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
"ts-node": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-file-datalake/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"source-map-support": "^0.5.9",
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-file-share/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"sinon": "^17.0.0",
"source-map-support": "^0.5.9",
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-internal-avro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
"ts-node": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-queue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
"ts-node": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/template/template-dpg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"c8": "^8.0.0",
"puppeteer": "^19.2.2",
"puppeteer": "^22.0.0",
"rimraf": "^3.0.2",
"ts-node": "^10.0.0",
"typescript": "~5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion sdk/test-utils/recorder/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- Clarify error when attempting to redirect a request but the recorder has not been started
- Forward mismatch error when recording file cannot be found during `start` call in playback mode
- Add more descriptive message in the case that the test proxy has not been started before running the tests

- Ignore `Accept-Language` header for browsers in Playback mode.
## 3.0.0 (2023-03-07)

### Features Added
Expand Down
Loading

0 comments on commit 18d6d50

Please sign in to comment.