From 8e8cff7b3caff1cebcdbac92635550d669da75d4 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Fri, 3 Feb 2023 16:19:18 +1000 Subject: [PATCH 01/37] Add sample reassure perf-test --- .../src/gallery/test/index.perf-test.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 packages/block-library/src/gallery/test/index.perf-test.js diff --git a/packages/block-library/src/gallery/test/index.perf-test.js b/packages/block-library/src/gallery/test/index.perf-test.js new file mode 100644 index 0000000000000..92bd2feeedf7f --- /dev/null +++ b/packages/block-library/src/gallery/test/index.perf-test.js @@ -0,0 +1,21 @@ +/** + * External dependencies + */ +import { getBlock, setupCoreBlocks } from 'test/helpers'; +import { measurePerformance } from 'reassure'; + +/** + * Internal dependencies + */ +import { addGalleryBlock } from './helpers'; + +setupCoreBlocks(); + +describe( 'Gallery block', () => { + it( 'measures performance', async () => { + const screen = await addGalleryBlock(); + const galleryBlock = getBlock( screen, 'Gallery' ); + + await measurePerformance( galleryBlock, { screen } ); + } ); +} ); From cc400b772eadcff1958b82af98a722d53696791d Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Wed, 8 Feb 2023 16:05:50 +1000 Subject: [PATCH 02/37] Add reassure library --- .reassure/current.perf | 1 + package-lock.json | 477 ++++++++++++++++++++++++++++++++++++++++- package.json | 1 + 3 files changed, 478 insertions(+), 1 deletion(-) create mode 100644 .reassure/current.perf diff --git a/.reassure/current.perf b/.reassure/current.perf new file mode 100644 index 0000000000000..c598612ace19a --- /dev/null +++ b/.reassure/current.perf @@ -0,0 +1 @@ +{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"0906aade3bff42ea7b6f027e5d9b3dcaa448982f"}} diff --git a/package-lock.json b/package-lock.json index 828769e19e435..1b308a7045a96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1818,6 +1818,193 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@callstack/reassure-cli": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@callstack/reassure-cli/-/reassure-cli-0.6.1.tgz", + "integrity": "sha512-c5Pihix9anX9hSLsN8Y5cpRUuB5vHSFeaGAHuiRyNLlEOAIEODjQIOCQ7MkxEiWd5rT5t00m9EMfANb1FcnfiA==", + "dev": true, + "requires": { + "@callstack/reassure-compare": "0.3.0", + "simple-git": "^3.16.0", + "yargs": "^17.6.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "simple-git": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.16.0.tgz", + "integrity": "sha512-zuWYsOLEhbJRWVxpjdiXl6eyAyGo/KzVW+KFhhw9MqEEJttcq+32jTWSGyxTdf9e/YCohxRE+9xpWFj9FdiJNw==", + "dev": true, + "requires": { + "@kwsites/file-exists": "^1.1.1", + "@kwsites/promise-deferred": "^1.1.1", + "debug": "^4.3.4" + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", + "dev": true, + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true + } + } + }, + "@callstack/reassure-compare": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@callstack/reassure-compare/-/reassure-compare-0.3.0.tgz", + "integrity": "sha512-1TIUhzZELlXkVJE9wH6qm7IkoLChTsKj7rOE9h86yRX4y4vrSru9cdHwktjsuopQ543YbOxehMMx6tGbefsGBA==", + "dev": true, + "requires": { + "markdown-builder": "^0.9.0", + "markdown-table": "^2.0.0", + "zod": "^3.20.2" + }, + "dependencies": { + "markdown-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "dev": true, + "requires": { + "repeat-string": "^1.0.0" + } + } + } + }, + "@callstack/reassure-danger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@callstack/reassure-danger/-/reassure-danger-0.1.1.tgz", + "integrity": "sha512-lfza+qBdvVYtP7WvMTT+LfjBfuYsXZ4RxuBldsL8wJArGeCl3OZwUg+9bTo8v6kk/nY8memk5HxrCwWDSO24UA==", + "dev": true + }, + "@callstack/reassure-measure": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@callstack/reassure-measure/-/reassure-measure-0.3.1.tgz", + "integrity": "sha512-A7gdyA9nfm6TZt4bQs5bfgy9SOFn8FmMdOjPojSpmpSyECXRK/7aMqqBIuwPt4jgIFFDiEFsd5w88FgsE13CTQ==", + "dev": true, + "requires": { + "mathjs": "^10.1.1" + } + }, "@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", @@ -28527,7 +28714,7 @@ "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, "code-point-at": { @@ -28722,6 +28909,12 @@ } } }, + "complex.js": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.1.1.tgz", + "integrity": "sha512-8njCHOTtFFLtegk6zQo0kkVX1rngygb/KQI6z1qZxlFI3scluC+LVTCFbrkWjBv4vvLlbQ9t88IPMC6k95VTTg==", + "dev": true + }, "component-emitter": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", @@ -31530,6 +31723,12 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, + "escape-latex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz", + "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -37983,6 +38182,12 @@ "iterate-iterator": "^1.0.1" } }, + "javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "dev": true + }, "jed": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/jed/-/jed-1.1.1.tgz", @@ -40876,6 +41081,201 @@ "object-visit": "^1.0.0" } }, + "markdown-builder": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/markdown-builder/-/markdown-builder-0.9.0.tgz", + "integrity": "sha512-UovCyEEzMeKE7l88fbOk9SIJkOG7KXkg+TdudN8rvOtCtBO5uu1X27HSnM7LS/xH+vaShJLGpkBcYYcojWNx/g==", + "dev": true, + "requires": { + "husky": "^1.0.0-rc.14" + }, + "dependencies": { + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "husky": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/husky/-/husky-1.3.1.tgz", + "integrity": "sha512-86U6sVVVf4b5NYSZ0yvv88dRgBSSXXmHaiq5pP4KDj5JVzdwKgBjEtUPOm8hcoytezFwbU+7gotXNhpHdystlg==", + "dev": true, + "requires": { + "cosmiconfig": "^5.0.7", + "execa": "^1.0.0", + "find-up": "^3.0.0", + "get-stdin": "^6.0.0", + "is-ci": "^2.0.0", + "pkg-dir": "^3.0.0", + "please-upgrade-node": "^3.1.1", + "read-pkg": "^4.0.1", + "run-node": "^1.0.0", + "slash": "^2.0.0" + } + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "read-pkg": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz", + "integrity": "sha512-+UBirHHDm5J+3WDmLBZYSklRYg82nMlz+enn+GMZ22nSR2f4bzxmhso6rzQW/3mT2PVzpzDTiYIZahk8UmZ44w==", + "dev": true, + "requires": { + "normalize-package-data": "^2.3.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + } + } + }, "markdown-escapes": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.2.tgz", @@ -41017,6 +41417,46 @@ "integrity": "sha512-oEacRUVeTJ5D5hW1UYd2qExYI0oELdYK72k1TKGvIeYJIbqQWAz476NAc7LNixSySUhcNl++d02DvX0ccDk9/w==", "dev": true }, + "mathjs": { + "version": "10.6.4", + "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-10.6.4.tgz", + "integrity": "sha512-omQyvRE1jIy+3k2qsqkWASOcd45aZguXZDckr3HtnTYyXk5+2xpVfC3kATgbO2Srjxlqww3TVdhD0oUdZ/hiFA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.18.6", + "complex.js": "^2.1.1", + "decimal.js": "^10.3.1", + "escape-latex": "^1.2.0", + "fraction.js": "^4.2.0", + "javascript-natural-sort": "^0.7.1", + "seedrandom": "^3.0.5", + "tiny-emitter": "^2.1.0", + "typed-function": "^2.1.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz", + "integrity": "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.11" + } + }, + "fraction.js": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz", + "integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "dev": true + } + } + }, "mathml-tag-names": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", @@ -49530,6 +49970,17 @@ "reakit-utils": "^0.15.1" } }, + "reassure": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/reassure/-/reassure-0.7.1.tgz", + "integrity": "sha512-dCDo4AInl48Q66PAbF3JzV5WVGIQu2AiCNAy+zhcZ0ESalb4zsVuAvhLdgXCsWr9DhPju63rEGgoNWl9noDVKg==", + "dev": true, + "requires": { + "@callstack/reassure-cli": "0.6.1", + "@callstack/reassure-danger": "0.1.1", + "@callstack/reassure-measure": "0.3.1" + } + }, "recast": { "version": "0.20.5", "resolved": "https://registry.npmjs.org/recast/-/recast-0.20.5.tgz", @@ -50689,6 +51140,12 @@ } } }, + "run-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz", + "integrity": "sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==", + "dev": true + }, "run-parallel": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", @@ -51133,6 +51590,12 @@ } } }, + "seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==", + "dev": true + }, "select": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", @@ -55153,6 +55616,12 @@ } } }, + "typed-function": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-2.1.0.tgz", + "integrity": "sha512-bctQIOqx2iVbWGDGPWwIm18QScpu2XRmkC19D8rQGFsjKSgteq/o1hTZvIG/wuDq8fanpBDrLkLq+aEN/6y5XQ==", + "dev": true + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -58119,6 +58588,12 @@ } } }, + "zod": { + "version": "3.20.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.20.2.tgz", + "integrity": "sha512-1MzNQdAvO+54H+EaK5YpyEy0T+Ejo/7YLHS93G3RnYWh5gaotGHwGeN/ZO687qEDU2y4CdStQYXVHIgrUl5UVQ==", + "dev": true + }, "zwitch": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", diff --git a/package.json b/package.json index 4755725645a5d..344be617352c2 100644 --- a/package.json +++ b/package.json @@ -223,6 +223,7 @@ "react-native-url-polyfill": "1.1.2", "react-refresh": "0.10.0", "react-test-renderer": "18.2.0", + "reassure": "0.7.1", "redux": "4.1.2", "resize-observer-polyfill": "1.5.1", "rimraf": "3.0.2", From 3033ecf9b5ae3641c6b37f91aeed9c6ae4b1d399 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 9 Feb 2023 18:32:19 +1000 Subject: [PATCH 03/37] Add text input performance tests --- .reassure/current.perf | 2 +- .../src/gallery/test/index.perf-test.js | 2 +- .../html-text-input/test/index.perf-test.js | 39 +++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 packages/components/src/mobile/html-text-input/test/index.perf-test.js diff --git a/.reassure/current.perf b/.reassure/current.perf index c598612ace19a..f3bc62ee178d4 100644 --- a/.reassure/current.perf +++ b/.reassure/current.perf @@ -1 +1 @@ -{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"0906aade3bff42ea7b6f027e5d9b3dcaa448982f"}} +{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"6c9eef9ced08706138412b45cc21b419dc0e50de"}} diff --git a/packages/block-library/src/gallery/test/index.perf-test.js b/packages/block-library/src/gallery/test/index.perf-test.js index 92bd2feeedf7f..4f98a54614376 100644 --- a/packages/block-library/src/gallery/test/index.perf-test.js +++ b/packages/block-library/src/gallery/test/index.perf-test.js @@ -1,8 +1,8 @@ /** * External dependencies */ -import { getBlock, setupCoreBlocks } from 'test/helpers'; import { measurePerformance } from 'reassure'; +import { getBlock, setupCoreBlocks } from 'test/helpers'; /** * Internal dependencies diff --git a/packages/components/src/mobile/html-text-input/test/index.perf-test.js b/packages/components/src/mobile/html-text-input/test/index.perf-test.js new file mode 100644 index 0000000000000..e3362ce9adcc8 --- /dev/null +++ b/packages/components/src/mobile/html-text-input/test/index.perf-test.js @@ -0,0 +1,39 @@ +/** + * External dependencies + */ +import { measurePerformance } from 'reassure'; +import { fireEvent, render } from '@testing-library/react-native'; + +/** + * Internal dependencies + */ +import { HTMLTextInput } from '..'; + +// Finds the Content TextInput in our HTMLInputView. +const findContentTextInput = ( screen ) => { + return screen.getByLabelText( 'html-view-content' ); +}; + +describe( 'HTMLTextInput Performance', () => { + it( 'measures performance', async () => { + const onChange = jest.fn(); + + const utils = render( + + ); + + const scenario = async ( screen ) => { + // Simulate user typing text. + const htmlTextInput = findContentTextInput( screen ); + fireEvent( htmlTextInput, 'changeText', 'text' ); + + // Check if the onChange is called and the state is updated. + expect( onChange ).toHaveBeenCalledTimes( 1 ); + expect( onChange ).toHaveBeenCalledWith( 'text' ); + + expect( screen.getByDisplayValue( 'text' ) ).toBeInTheDocument(); + }; + + await measurePerformance( utils, { scenario } ); + } ); +} ); From a8397469dcdb74debd32697316bd51b017332f60 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 21 Mar 2023 15:45:24 +1000 Subject: [PATCH 04/37] Resolve merge conflicts --- .../src/gallery/test/index.perf-test.js | 21 ---------- .../html-text-input/test/index.perf-test.js | 39 ------------------- .../.reassure/current.perf | 1 + packages/react-native-editor/package.json | 1 + 4 files changed, 2 insertions(+), 60 deletions(-) delete mode 100644 packages/block-library/src/gallery/test/index.perf-test.js delete mode 100644 packages/components/src/mobile/html-text-input/test/index.perf-test.js create mode 100644 packages/react-native-editor/.reassure/current.perf diff --git a/packages/block-library/src/gallery/test/index.perf-test.js b/packages/block-library/src/gallery/test/index.perf-test.js deleted file mode 100644 index 4f98a54614376..0000000000000 --- a/packages/block-library/src/gallery/test/index.perf-test.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * External dependencies - */ -import { measurePerformance } from 'reassure'; -import { getBlock, setupCoreBlocks } from 'test/helpers'; - -/** - * Internal dependencies - */ -import { addGalleryBlock } from './helpers'; - -setupCoreBlocks(); - -describe( 'Gallery block', () => { - it( 'measures performance', async () => { - const screen = await addGalleryBlock(); - const galleryBlock = getBlock( screen, 'Gallery' ); - - await measurePerformance( galleryBlock, { screen } ); - } ); -} ); diff --git a/packages/components/src/mobile/html-text-input/test/index.perf-test.js b/packages/components/src/mobile/html-text-input/test/index.perf-test.js deleted file mode 100644 index e3362ce9adcc8..0000000000000 --- a/packages/components/src/mobile/html-text-input/test/index.perf-test.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * External dependencies - */ -import { measurePerformance } from 'reassure'; -import { fireEvent, render } from '@testing-library/react-native'; - -/** - * Internal dependencies - */ -import { HTMLTextInput } from '..'; - -// Finds the Content TextInput in our HTMLInputView. -const findContentTextInput = ( screen ) => { - return screen.getByLabelText( 'html-view-content' ); -}; - -describe( 'HTMLTextInput Performance', () => { - it( 'measures performance', async () => { - const onChange = jest.fn(); - - const utils = render( - - ); - - const scenario = async ( screen ) => { - // Simulate user typing text. - const htmlTextInput = findContentTextInput( screen ); - fireEvent( htmlTextInput, 'changeText', 'text' ); - - // Check if the onChange is called and the state is updated. - expect( onChange ).toHaveBeenCalledTimes( 1 ); - expect( onChange ).toHaveBeenCalledWith( 'text' ); - - expect( screen.getByDisplayValue( 'text' ) ).toBeInTheDocument(); - }; - - await measurePerformance( utils, { scenario } ); - } ); -} ); diff --git a/packages/react-native-editor/.reassure/current.perf b/packages/react-native-editor/.reassure/current.perf new file mode 100644 index 0000000000000..0222410018ca3 --- /dev/null +++ b/packages/react-native-editor/.reassure/current.perf @@ -0,0 +1 @@ +{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"af3f88947bb2d1ab2b1163e48e329fc75fd791d7"}} diff --git a/packages/react-native-editor/package.json b/packages/react-native-editor/package.json index f7bda6bf1cba1..3d4b6c4a2ea9f 100644 --- a/packages/react-native-editor/package.json +++ b/packages/react-native-editor/package.json @@ -108,6 +108,7 @@ "test": "cross-env NODE_ENV=test jest --verbose --config ../../test/native/jest.config.js", "test:debug": "cross-env NODE_ENV=test node --inspect-brk ../../node_modules/.bin/jest --runInBand --verbose --config ../../test/native/jest.config.js", "test:update": "npm run test -- --updateSnapshot", + "test:perf": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"/**/*.perf-test.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure", "device-tests": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=3 --testPathIgnorePatterns='canary|gutenberg-editor-rendering' --verbose --config ./jest_ui.config.js", "device-tests-canary": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=2 --testPathPattern=@canary --verbose --config ./jest_ui.config.js", "device-tests:local": "cross-env NODE_ENV=test jest --runInBand --detectOpenHandles --verbose --forceExit --config ./jest_ui.config.js", From f1aa9710d7a06541a62de69eca57380045a068d9 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Fri, 10 Feb 2023 17:24:40 +1000 Subject: [PATCH 05/37] Add RichText performance test --- .../rich-text/test/index.perf-test.js | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 packages/block-editor/src/components/rich-text/test/index.perf-test.js diff --git a/packages/block-editor/src/components/rich-text/test/index.perf-test.js b/packages/block-editor/src/components/rich-text/test/index.perf-test.js new file mode 100644 index 0000000000000..2425ca671ae6b --- /dev/null +++ b/packages/block-editor/src/components/rich-text/test/index.perf-test.js @@ -0,0 +1,45 @@ +/** + * External dependencies + */ +import { measurePerformance } from 'reassure'; +import { fireEvent } from '@testing-library/react-native'; + +/** + * WordPress dependencies + */ +import { RichText } from '@wordpress/block-editor'; + +describe( 'RichText Performance', () => { + it( 'measures performance', async () => { + const onChange = jest.fn(); + + const changeTextOfRichText = ( richText, text ) => { + fireEvent( richText, 'focus' ); + fireEvent( richText, 'onChange', { + nativeEvent: { + eventCount: 1, + target: undefined, + text, + }, + } ); + }; + + const scenario = async () => { + const richTextInput = ; + // Simulate user typing text. + fireEvent( richTextInput, 'focus' ); + + changeTextOfRichText( + richTextInput, + 'Bold italic strikethrough text' + ); + + // Check if the onChange is called and the state is updated. + expect( onChange ).toHaveBeenCalledTimes( 1 ); + }; + + await measurePerformance( , { + scenario, + } ); + } ); +} ); From ebd544232ae63185f5f39cd54c3ab60de540a96e Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Fri, 10 Feb 2023 17:25:12 +1000 Subject: [PATCH 06/37] Update package-lock.json and Reassure current.perf hashes --- .reassure/current.perf | 2 +- packages/react-native-editor/.reassure/current.perf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.reassure/current.perf b/.reassure/current.perf index f3bc62ee178d4..98212f39738b7 100644 --- a/.reassure/current.perf +++ b/.reassure/current.perf @@ -1 +1 @@ -{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"6c9eef9ced08706138412b45cc21b419dc0e50de"}} +{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"e4beb96b79fa5ac90ac12f6a4d3c81f8d6a10489"}} diff --git a/packages/react-native-editor/.reassure/current.perf b/packages/react-native-editor/.reassure/current.perf index 0222410018ca3..98212f39738b7 100644 --- a/packages/react-native-editor/.reassure/current.perf +++ b/packages/react-native-editor/.reassure/current.perf @@ -1 +1 @@ -{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"af3f88947bb2d1ab2b1163e48e329fc75fd791d7"}} +{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"e4beb96b79fa5ac90ac12f6a4d3c81f8d6a10489"}} From 6def7c82f89aa5245443f6027fb3a33aaccda3d3 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Wed, 15 Feb 2023 17:05:07 +1000 Subject: [PATCH 07/37] Resolve merge conflicts --- .../rich-text/test/index.perf-test.js | 31 +++---- .../src/gallery/test/index.perf-test.js | 91 +++++++++++++++++++ test/native/helpers.js | 1 + 3 files changed, 103 insertions(+), 20 deletions(-) create mode 100644 packages/block-library/src/gallery/test/index.perf-test.js diff --git a/packages/block-editor/src/components/rich-text/test/index.perf-test.js b/packages/block-editor/src/components/rich-text/test/index.perf-test.js index 2425ca671ae6b..a1f44f8971147 100644 --- a/packages/block-editor/src/components/rich-text/test/index.perf-test.js +++ b/packages/block-editor/src/components/rich-text/test/index.perf-test.js @@ -1,8 +1,11 @@ /** * External dependencies */ -import { measurePerformance } from 'reassure'; -import { fireEvent } from '@testing-library/react-native'; +import { + changeTextOfRichText, + fireEvent, + measurePerformance, +} from 'test/helpers'; /** * WordPress dependencies @@ -10,23 +13,11 @@ import { fireEvent } from '@testing-library/react-native'; import { RichText } from '@wordpress/block-editor'; describe( 'RichText Performance', () => { - it( 'measures performance', async () => { - const onChange = jest.fn(); - - const changeTextOfRichText = ( richText, text ) => { - fireEvent( richText, 'focus' ); - fireEvent( richText, 'onChange', { - nativeEvent: { - eventCount: 1, - target: undefined, - text, - }, - } ); - }; - + // eslint-disable-next-line jest/no-done-callback + it( 'performance is stable', async ( screen ) => { const scenario = async () => { - const richTextInput = ; - // Simulate user typing text. + const richTextInput = screen.getByTestId( 'performance' ); + fireEvent( richTextInput, 'focus' ); changeTextOfRichText( @@ -35,10 +26,10 @@ describe( 'RichText Performance', () => { ); // Check if the onChange is called and the state is updated. - expect( onChange ).toHaveBeenCalledTimes( 1 ); + expect( changeTextOfRichText ).toHaveBeenCalledTimes( 1 ); }; - await measurePerformance( , { + await measurePerformance( , { scenario, } ); } ); diff --git a/packages/block-library/src/gallery/test/index.perf-test.js b/packages/block-library/src/gallery/test/index.perf-test.js new file mode 100644 index 0000000000000..863f0a5e616a4 --- /dev/null +++ b/packages/block-library/src/gallery/test/index.perf-test.js @@ -0,0 +1,91 @@ +/** + * External dependencies + */ +import { + fireEvent, + getBlock, + measurePerformance, + setupCoreBlocks, + within, +} from 'test/helpers'; + +/** + * Internal dependencies + */ +import { + addGalleryBlock, + initializeWithGalleryBlock, + getGalleryItem, +} from './helpers'; + +const media = [ + { + localId: 1, + localUrl: 'file:///local-image-1.jpeg', + serverId: 2000, + serverUrl: 'https://test-site.files.wordpress.com/local-image-1.jpeg', + }, + { + localId: 2, + localUrl: 'file:///local-image-2.jpeg', + serverId: 2001, + serverUrl: 'https://test-site.files.wordpress.com/local-image-2.jpeg', + }, + { + localId: 3, + localUrl: 'file:///local-image-3.jpeg', + serverId: 2002, + serverUrl: 'https://test-site.files.wordpress.com/local-image-3.jpeg', + }, +]; + +setupCoreBlocks(); + +describe( 'Gallery block', () => { + it( 'inserts block', async () => { + const screen = await addGalleryBlock(); + + expect( getBlock( screen, 'Gallery' ) ).toBeVisible(); + + await measurePerformance( screen ); + } ); + + it( 'selects a gallery item', async () => { + const { galleryBlock } = await initializeWithGalleryBlock( { + numberOfItems: 1, + media, + selected: false, + } ); + + const scenario = async () => { + const galleryItem = getGalleryItem( galleryBlock, 1 ); + fireEvent.press( galleryItem ); + + expect( galleryItem ).toBeVisible(); + }; + + await measurePerformance( galleryBlock, { scenario } ); + } ); + + it( 'shows appender button when gallery has images', async () => { + const { galleryBlock } = await initializeWithGalleryBlock( { + numberOfItems: 1, + media, + } ); + + const scenario = async ( screen ) => { + const appenderButton = within( galleryBlock ).getByTestId( + 'media-placeholder-appender-icon' + ); + fireEvent.press( appenderButton ); + + expect( screen.getByText( 'Choose from device' ) ).toBeVisible(); + expect( screen.getByText( 'Take a Photo' ) ).toBeVisible(); + expect( + screen.getByText( 'WordPress Media Library' ) + ).toBeVisible(); + }; + + await measurePerformance( galleryBlock, { scenario } ); + } ); +} ); diff --git a/test/native/helpers.js b/test/native/helpers.js index 01599d3fac18c..9a2bfda90c104 100644 --- a/test/native/helpers.js +++ b/test/native/helpers.js @@ -1,4 +1,5 @@ export * from '@testing-library/react-native'; +export { measurePerformance } from 'reassure'; export * from './integration-test-helpers'; From e764fdc08ee74da6d07668953ffd7072518ac202 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Wed, 15 Feb 2023 17:05:39 +1000 Subject: [PATCH 08/37] Remove HTMLTextInput performance test and update current perf --- packages/react-native-editor/.reassure/current.perf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/.reassure/current.perf b/packages/react-native-editor/.reassure/current.perf index 98212f39738b7..8f595ac0ab80f 100644 --- a/packages/react-native-editor/.reassure/current.perf +++ b/packages/react-native-editor/.reassure/current.perf @@ -1 +1 @@ -{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"e4beb96b79fa5ac90ac12f6a4d3c81f8d6a10489"}} +{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"5e2287c1728dada2e75ce8e81dd07ce045d8ad55"}} From ff9384c4c56c8da59b5f296c95df368190f94313 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Wed, 15 Feb 2023 17:11:38 +1000 Subject: [PATCH 09/37] Remove Reassure current.perf files from git control --- .gitignore | 1 + .reassure/current.perf | 1 - packages/react-native-editor/.reassure/current.perf | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 .reassure/current.perf delete mode 100644 packages/react-native-editor/.reassure/current.perf diff --git a/.gitignore b/.gitignore index ee043c9a3e4b2..3605aca9a6108 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ gutenberg.zip coverage *-performance-results.json .phpunit.result.cache +.reassure # Directories/files that may appear in your environment *.log diff --git a/.reassure/current.perf b/.reassure/current.perf deleted file mode 100644 index 98212f39738b7..0000000000000 --- a/.reassure/current.perf +++ /dev/null @@ -1 +0,0 @@ -{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"e4beb96b79fa5ac90ac12f6a4d3c81f8d6a10489"}} diff --git a/packages/react-native-editor/.reassure/current.perf b/packages/react-native-editor/.reassure/current.perf deleted file mode 100644 index 8f595ac0ab80f..0000000000000 --- a/packages/react-native-editor/.reassure/current.perf +++ /dev/null @@ -1 +0,0 @@ -{"metadata":{"branch":"rnmobile/add-reassure","commitHash":"5e2287c1728dada2e75ce8e81dd07ce045d8ad55"}} From 3d357c0ba1cf780bd64aaa702e8eeb4573d80eaf Mon Sep 17 00:00:00 2001 From: David Calhoun <438664+dcalhoun@users.noreply.github.com> Date: Wed, 15 Feb 2023 19:20:39 -0500 Subject: [PATCH 10/37] Resolve merge conflicts --- .../test/{index.perf-test.js => index.perf-native.js} | 11 ++++------- .../test/{index.perf-test.js => index.perf-native.js} | 0 packages/eslint-plugin/configs/test-unit.js | 6 ++++++ packages/react-native-editor/package.json | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) rename packages/block-editor/src/components/rich-text/test/{index.perf-test.js => index.perf-native.js} (57%) rename packages/block-library/src/gallery/test/{index.perf-test.js => index.perf-native.js} (100%) diff --git a/packages/block-editor/src/components/rich-text/test/index.perf-test.js b/packages/block-editor/src/components/rich-text/test/index.perf-native.js similarity index 57% rename from packages/block-editor/src/components/rich-text/test/index.perf-test.js rename to packages/block-editor/src/components/rich-text/test/index.perf-native.js index a1f44f8971147..d3fb6b2628be1 100644 --- a/packages/block-editor/src/components/rich-text/test/index.perf-test.js +++ b/packages/block-editor/src/components/rich-text/test/index.perf-native.js @@ -5,6 +5,7 @@ import { changeTextOfRichText, fireEvent, measurePerformance, + screen, } from 'test/helpers'; /** @@ -13,10 +14,9 @@ import { import { RichText } from '@wordpress/block-editor'; describe( 'RichText Performance', () => { - // eslint-disable-next-line jest/no-done-callback - it( 'performance is stable', async ( screen ) => { + it( 'performance is stable', async () => { const scenario = async () => { - const richTextInput = screen.getByTestId( 'performance' ); + const richTextInput = screen.getByLabelText( 'Text input. Empty' ); fireEvent( richTextInput, 'focus' ); @@ -24,12 +24,9 @@ describe( 'RichText Performance', () => { richTextInput, 'Bold italic strikethrough text' ); - - // Check if the onChange is called and the state is updated. - expect( changeTextOfRichText ).toHaveBeenCalledTimes( 1 ); }; - await measurePerformance( , { + await measurePerformance( , { scenario, } ); } ); diff --git a/packages/block-library/src/gallery/test/index.perf-test.js b/packages/block-library/src/gallery/test/index.perf-native.js similarity index 100% rename from packages/block-library/src/gallery/test/index.perf-test.js rename to packages/block-library/src/gallery/test/index.perf-native.js diff --git a/packages/eslint-plugin/configs/test-unit.js b/packages/eslint-plugin/configs/test-unit.js index 5d71776c0a778..af922df9fdd74 100644 --- a/packages/eslint-plugin/configs/test-unit.js +++ b/packages/eslint-plugin/configs/test-unit.js @@ -1,3 +1,9 @@ module.exports = { extends: [ 'plugin:jest/recommended' ], + rules: { + 'jest/expect-expect': [ + 'error', + { assertFunctionNames: [ 'expect', 'measurePerformance' ] }, + ], + }, }; diff --git a/packages/react-native-editor/package.json b/packages/react-native-editor/package.json index 3d4b6c4a2ea9f..c92c9ee7113ba 100644 --- a/packages/react-native-editor/package.json +++ b/packages/react-native-editor/package.json @@ -108,7 +108,8 @@ "test": "cross-env NODE_ENV=test jest --verbose --config ../../test/native/jest.config.js", "test:debug": "cross-env NODE_ENV=test node --inspect-brk ../../node_modules/.bin/jest --runInBand --verbose --config ../../test/native/jest.config.js", "test:update": "npm run test -- --updateSnapshot", - "test:perf": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"/**/*.perf-test.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure", + "test:perf": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"/**/*.perf-native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure", + "device-tests": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=3 --testPathIgnorePatterns=@canary --verbose --config ./jest_ui.config.js", "device-tests": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=3 --testPathIgnorePatterns='canary|gutenberg-editor-rendering' --verbose --config ./jest_ui.config.js", "device-tests-canary": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=2 --testPathPattern=@canary --verbose --config ./jest_ui.config.js", "device-tests:local": "cross-env NODE_ENV=test jest --runInBand --detectOpenHandles --verbose --forceExit --config ./jest_ui.config.js", From c09dc969ac83a38841bc88bb25ef74ccc367e766 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 16 Feb 2023 11:49:32 +1000 Subject: [PATCH 11/37] Update package-lock.json --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b308a7045a96..24dcd3c4a4c40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30286,7 +30286,7 @@ "css.escape": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", - "integrity": "sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s=", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", "dev": true }, "cssesc": { @@ -40852,7 +40852,7 @@ "lz-string": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz", - "integrity": "sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=", + "integrity": "sha512-0ckx7ZHRPqb0oUm8zNr+90mtf9DQB60H1wMCjBtfi62Kl3a7JbHob6gA2bC+xRvZoOL+1hzUK8jeuEIQE8svEQ==", "dev": true }, "macos-release": { From 14b923b9206cf4a63f14416de2b513f73248d089 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 16 Feb 2023 16:33:40 +1000 Subject: [PATCH 12/37] Resolve merge conflicts --- .github/workflows/performance.yml | 8 ++++++++ bin/reassure-tests.sh | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 bin/reassure-tests.sh diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 18f11e55b3de8..37853edd40b94 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -95,3 +95,11 @@ jobs: name: failures-artifacts path: ./__test-results/artifacts if-no-files-found: ignore + + - name: Run Reassure performance tests + run: cd gutenberg/bin && ./reassure-tests.sh + + - name: Run Danger.js + run: yarn danger ci + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/bin/reassure-tests.sh b/bin/reassure-tests.sh new file mode 100755 index 0000000000000..5bf323d1509c8 --- /dev/null +++ b/bin/reassure-tests.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -e + +# Move out of bin directory to Gutenberg project root +cd ../ + +BASELINE_BRANCH=${BASELINE_BRANCH:="trunk"} + +# Required for `git switch` on CI +git fetch origin + +# Gather baseline perf measurements +git switch "$BASELINE_BRANCH" +npm --cwd ci --force +npm run native test:perf --baseline + +# Gather current perf measurements & compare results +git switch --detach - +npm ci --force +npm run native test:perf \ No newline at end of file From 2dcfe0e40511d270321326861e4ee4eb48b35bc3 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 16 Feb 2023 16:35:19 +1000 Subject: [PATCH 13/37] Remove Gallery block perf-native test --- .../src/gallery/test/index.perf-native.js | 91 ------------------- 1 file changed, 91 deletions(-) delete mode 100644 packages/block-library/src/gallery/test/index.perf-native.js diff --git a/packages/block-library/src/gallery/test/index.perf-native.js b/packages/block-library/src/gallery/test/index.perf-native.js deleted file mode 100644 index 863f0a5e616a4..0000000000000 --- a/packages/block-library/src/gallery/test/index.perf-native.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * External dependencies - */ -import { - fireEvent, - getBlock, - measurePerformance, - setupCoreBlocks, - within, -} from 'test/helpers'; - -/** - * Internal dependencies - */ -import { - addGalleryBlock, - initializeWithGalleryBlock, - getGalleryItem, -} from './helpers'; - -const media = [ - { - localId: 1, - localUrl: 'file:///local-image-1.jpeg', - serverId: 2000, - serverUrl: 'https://test-site.files.wordpress.com/local-image-1.jpeg', - }, - { - localId: 2, - localUrl: 'file:///local-image-2.jpeg', - serverId: 2001, - serverUrl: 'https://test-site.files.wordpress.com/local-image-2.jpeg', - }, - { - localId: 3, - localUrl: 'file:///local-image-3.jpeg', - serverId: 2002, - serverUrl: 'https://test-site.files.wordpress.com/local-image-3.jpeg', - }, -]; - -setupCoreBlocks(); - -describe( 'Gallery block', () => { - it( 'inserts block', async () => { - const screen = await addGalleryBlock(); - - expect( getBlock( screen, 'Gallery' ) ).toBeVisible(); - - await measurePerformance( screen ); - } ); - - it( 'selects a gallery item', async () => { - const { galleryBlock } = await initializeWithGalleryBlock( { - numberOfItems: 1, - media, - selected: false, - } ); - - const scenario = async () => { - const galleryItem = getGalleryItem( galleryBlock, 1 ); - fireEvent.press( galleryItem ); - - expect( galleryItem ).toBeVisible(); - }; - - await measurePerformance( galleryBlock, { scenario } ); - } ); - - it( 'shows appender button when gallery has images', async () => { - const { galleryBlock } = await initializeWithGalleryBlock( { - numberOfItems: 1, - media, - } ); - - const scenario = async ( screen ) => { - const appenderButton = within( galleryBlock ).getByTestId( - 'media-placeholder-appender-icon' - ); - fireEvent.press( appenderButton ); - - expect( screen.getByText( 'Choose from device' ) ).toBeVisible(); - expect( screen.getByText( 'Take a Photo' ) ).toBeVisible(); - expect( - screen.getByText( 'WordPress Media Library' ) - ).toBeVisible(); - }; - - await measurePerformance( galleryBlock, { scenario } ); - } ); -} ); From 37725962d87812ed548f3459b2735577d23944f0 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 21 Mar 2023 16:05:46 +1000 Subject: [PATCH 14/37] Remove duplicate device-tests command --- packages/react-native-editor/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-native-editor/package.json b/packages/react-native-editor/package.json index c92c9ee7113ba..32e9e7fcaee60 100644 --- a/packages/react-native-editor/package.json +++ b/packages/react-native-editor/package.json @@ -109,7 +109,6 @@ "test:debug": "cross-env NODE_ENV=test node --inspect-brk ../../node_modules/.bin/jest --runInBand --verbose --config ../../test/native/jest.config.js", "test:update": "npm run test -- --updateSnapshot", "test:perf": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"/**/*.perf-native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure", - "device-tests": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=3 --testPathIgnorePatterns=@canary --verbose --config ./jest_ui.config.js", "device-tests": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=3 --testPathIgnorePatterns='canary|gutenberg-editor-rendering' --verbose --config ./jest_ui.config.js", "device-tests-canary": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=2 --testPathPattern=@canary --verbose --config ./jest_ui.config.js", "device-tests:local": "cross-env NODE_ENV=test jest --runInBand --detectOpenHandles --verbose --forceExit --config ./jest_ui.config.js", From 5deb5eda32ffee2e898162a40cffbc01a69f1131 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 21 Mar 2023 16:23:57 +1000 Subject: [PATCH 15/37] Add rich-text.perf-test.js to test/native directory --- test/native/rich-test.perf-native.js | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/native/rich-test.perf-native.js diff --git a/test/native/rich-test.perf-native.js b/test/native/rich-test.perf-native.js new file mode 100644 index 0000000000000..d3fb6b2628be1 --- /dev/null +++ b/test/native/rich-test.perf-native.js @@ -0,0 +1,33 @@ +/** + * External dependencies + */ +import { + changeTextOfRichText, + fireEvent, + measurePerformance, + screen, +} from 'test/helpers'; + +/** + * WordPress dependencies + */ +import { RichText } from '@wordpress/block-editor'; + +describe( 'RichText Performance', () => { + it( 'performance is stable', async () => { + const scenario = async () => { + const richTextInput = screen.getByLabelText( 'Text input. Empty' ); + + fireEvent( richTextInput, 'focus' ); + + changeTextOfRichText( + richTextInput, + 'Bold italic strikethrough text' + ); + }; + + await measurePerformance( , { + scenario, + } ); + } ); +} ); From 65ed0979222cc98db0d42140697fd653b804fbb5 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 21 Mar 2023 16:26:00 +1000 Subject: [PATCH 16/37] Add test:perf:baseline command --- packages/react-native-editor/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native-editor/package.json b/packages/react-native-editor/package.json index 32e9e7fcaee60..d7a694fa592c6 100644 --- a/packages/react-native-editor/package.json +++ b/packages/react-native-editor/package.json @@ -109,6 +109,7 @@ "test:debug": "cross-env NODE_ENV=test node --inspect-brk ../../node_modules/.bin/jest --runInBand --verbose --config ../../test/native/jest.config.js", "test:update": "npm run test -- --updateSnapshot", "test:perf": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"/**/*.perf-native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure", + "test:perf:baseline": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"/**/*.perf-native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure --baseline", "device-tests": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=3 --testPathIgnorePatterns='canary|gutenberg-editor-rendering' --verbose --config ./jest_ui.config.js", "device-tests-canary": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=2 --testPathPattern=@canary --verbose --config ./jest_ui.config.js", "device-tests:local": "cross-env NODE_ENV=test jest --runInBand --detectOpenHandles --verbose --forceExit --config ./jest_ui.config.js", From 6d922aee0e9b381d999932431406f5c37c6339af Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 21 Mar 2023 16:29:46 +1000 Subject: [PATCH 17/37] Remove Rich Text index.perf-test.js from rich-text/test directory --- .../rich-text/test/index.perf-native.js | 33 ------------------- 1 file changed, 33 deletions(-) delete mode 100644 packages/block-editor/src/components/rich-text/test/index.perf-native.js diff --git a/packages/block-editor/src/components/rich-text/test/index.perf-native.js b/packages/block-editor/src/components/rich-text/test/index.perf-native.js deleted file mode 100644 index d3fb6b2628be1..0000000000000 --- a/packages/block-editor/src/components/rich-text/test/index.perf-native.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * External dependencies - */ -import { - changeTextOfRichText, - fireEvent, - measurePerformance, - screen, -} from 'test/helpers'; - -/** - * WordPress dependencies - */ -import { RichText } from '@wordpress/block-editor'; - -describe( 'RichText Performance', () => { - it( 'performance is stable', async () => { - const scenario = async () => { - const richTextInput = screen.getByLabelText( 'Text input. Empty' ); - - fireEvent( richTextInput, 'focus' ); - - changeTextOfRichText( - richTextInput, - 'Bold italic strikethrough text' - ); - }; - - await measurePerformance( , { - scenario, - } ); - } ); -} ); From 89f52aef25e155554f966724df14fce1cfa2ed32 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 21 Mar 2023 16:50:01 +1000 Subject: [PATCH 18/37] Add Rich Text Reassure tests for onFocus and onBlur --- test/native/rich-test.perf-native.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/native/rich-test.perf-native.js b/test/native/rich-test.perf-native.js index d3fb6b2628be1..8c487aabd99c9 100644 --- a/test/native/rich-test.perf-native.js +++ b/test/native/rich-test.perf-native.js @@ -30,4 +30,28 @@ describe( 'RichText Performance', () => { scenario, } ); } ); + + it( 'should call onFocus when the TextInput component gains focus', async () => { + const scenario = async () => { + const richTextInput = screen.getByLabelText( 'Text input. Empty' ); + + fireEvent( richTextInput, 'focus' ); + }; + + await measurePerformance( , { + scenario, + } ); + } ); + + it( 'should call onBlue when the TextInput component is blurred', async () => { + const scenario = async () => { + const richTextInput = screen.getByLabelText( 'Text input. Empty' ); + + fireEvent( richTextInput, 'focus' ); + }; + + await measurePerformance( , { + scenario, + } ); + } ); } ); From a0fa40d7df3e28decd44a300b1f4053a2df73d21 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 21 Mar 2023 17:19:54 +1000 Subject: [PATCH 19/37] Add Rich Text Reassure tests for onSelectionChange and onKeyPress --- test/native/rich-test.perf-native.js | 34 ++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/test/native/rich-test.perf-native.js b/test/native/rich-test.perf-native.js index 8c487aabd99c9..732b3e4a44158 100644 --- a/test/native/rich-test.perf-native.js +++ b/test/native/rich-test.perf-native.js @@ -38,7 +38,7 @@ describe( 'RichText Performance', () => { fireEvent( richTextInput, 'focus' ); }; - await measurePerformance( , { + await measurePerformance( , { scenario, } ); } ); @@ -50,7 +50,37 @@ describe( 'RichText Performance', () => { fireEvent( richTextInput, 'focus' ); }; - await measurePerformance( , { + await measurePerformance( , { + scenario, + } ); + } ); + + it( 'should call onSelectionChange when the selection in the TextInput component changes', async () => { + const scenario = async () => { + const richTextInput = screen.getByLabelText( 'Text input. Empty' ); + + const selection = { start: 2, end: 4 }; + fireEvent( richTextInput, 'selectionChange', { + nativeEvent: { selection }, + } ); + }; + + await measurePerformance( + , + { + scenario, + } + ); + } ); + + it( 'should call onKeyPress when a key is pressed while the TextInput component is focused', async () => { + const scenario = async () => { + const richTextInput = screen.getByLabelText( 'Text input. Empty' ); + + fireEvent.changeText( richTextInput, 'abc' ); + }; + + await measurePerformance( , { scenario, } ); } ); From 5f8e66072e3027fbae538756d345125e9f9dbd62 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Wed, 22 Mar 2023 10:55:07 +1000 Subject: [PATCH 20/37] Fix typo in Rich Text perf test filename --- .../native/{rich-test.perf-native.js => rich-text.perf-native.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/native/{rich-test.perf-native.js => rich-text.perf-native.js} (100%) diff --git a/test/native/rich-test.perf-native.js b/test/native/rich-text.perf-native.js similarity index 100% rename from test/native/rich-test.perf-native.js rename to test/native/rich-text.perf-native.js From 7eccd3f8d19dbadb8de0e30876d72c39e249951c Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Wed, 22 Mar 2023 16:16:24 +1000 Subject: [PATCH 21/37] Remove Reassure CI code from Github workflow --- .github/workflows/performance.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 37853edd40b94..18f11e55b3de8 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -95,11 +95,3 @@ jobs: name: failures-artifacts path: ./__test-results/artifacts if-no-files-found: ignore - - - name: Run Reassure performance tests - run: cd gutenberg/bin && ./reassure-tests.sh - - - name: Run Danger.js - run: yarn danger ci - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3073ff538c5b0dd4522b9b911952b8c603214f36 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 23 Mar 2023 11:00:07 +1000 Subject: [PATCH 22/37] Update Rich Text performance test descriptions --- test/native/rich-text.perf-native.js | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/test/native/rich-text.perf-native.js b/test/native/rich-text.perf-native.js index 732b3e4a44158..88860a451480f 100644 --- a/test/native/rich-text.perf-native.js +++ b/test/native/rich-text.perf-native.js @@ -14,7 +14,7 @@ import { import { RichText } from '@wordpress/block-editor'; describe( 'RichText Performance', () => { - it( 'performance is stable', async () => { + it( 'should have stable performance when typing rich text', async () => { const scenario = async () => { const richTextInput = screen.getByLabelText( 'Text input. Empty' ); @@ -31,7 +31,7 @@ describe( 'RichText Performance', () => { } ); } ); - it( 'should call onFocus when the TextInput component gains focus', async () => { + it( 'should have stable performance when text input is focused', async () => { const scenario = async () => { const richTextInput = screen.getByLabelText( 'Text input. Empty' ); @@ -43,11 +43,11 @@ describe( 'RichText Performance', () => { } ); } ); - it( 'should call onBlue when the TextInput component is blurred', async () => { + it( 'should have stable performance when text input is blurred', async () => { const scenario = async () => { const richTextInput = screen.getByLabelText( 'Text input. Empty' ); - fireEvent( richTextInput, 'focus' ); + fireEvent( richTextInput, 'blur' ); }; await measurePerformance( , { @@ -55,13 +55,13 @@ describe( 'RichText Performance', () => { } ); } ); - it( 'should call onSelectionChange when the selection in the TextInput component changes', async () => { + it( 'should have stable performance when text is selected', async () => { const scenario = async () => { const richTextInput = screen.getByLabelText( 'Text input. Empty' ); const selection = { start: 2, end: 4 }; - fireEvent( richTextInput, 'selectionChange', { - nativeEvent: { selection }, + fireEvent( richTextInput, 'selectionChange', 2, 4, 'Hello', { + nativeEvent: { selection, text: 'Hello' }, } ); }; @@ -72,16 +72,4 @@ describe( 'RichText Performance', () => { } ); } ); - - it( 'should call onKeyPress when a key is pressed while the TextInput component is focused', async () => { - const scenario = async () => { - const richTextInput = screen.getByLabelText( 'Text input. Empty' ); - - fireEvent.changeText( richTextInput, 'abc' ); - }; - - await measurePerformance( , { - scenario, - } ); - } ); } ); From 8189878780fdbd1aa0d4d90df5a698b7d81340b7 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 23 Mar 2023 11:09:29 +1000 Subject: [PATCH 23/37] Update Rich Text performance test descriptions --- test/native/rich-text.perf-native.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/native/rich-text.perf-native.js b/test/native/rich-text.perf-native.js index 88860a451480f..a1c37b680dd32 100644 --- a/test/native/rich-text.perf-native.js +++ b/test/native/rich-text.perf-native.js @@ -14,7 +14,7 @@ import { import { RichText } from '@wordpress/block-editor'; describe( 'RichText Performance', () => { - it( 'should have stable performance when typing rich text', async () => { + it( 'performance is stable when typing rich text', async () => { const scenario = async () => { const richTextInput = screen.getByLabelText( 'Text input. Empty' ); @@ -31,7 +31,7 @@ describe( 'RichText Performance', () => { } ); } ); - it( 'should have stable performance when text input is focused', async () => { + it( 'performance is stable when text input is focused', async () => { const scenario = async () => { const richTextInput = screen.getByLabelText( 'Text input. Empty' ); @@ -43,7 +43,7 @@ describe( 'RichText Performance', () => { } ); } ); - it( 'should have stable performance when text input is blurred', async () => { + it( 'performance is stable when text input is blurred', async () => { const scenario = async () => { const richTextInput = screen.getByLabelText( 'Text input. Empty' ); @@ -55,7 +55,7 @@ describe( 'RichText Performance', () => { } ); } ); - it( 'should have stable performance when text is selected', async () => { + it( 'performance is stable when text is selected', async () => { const scenario = async () => { const richTextInput = screen.getByLabelText( 'Text input. Empty' ); From 5a95a04f6b4e78b0dba1020416919f4f34e063c4 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 23 Mar 2023 11:58:05 +1000 Subject: [PATCH 24/37] Move Rich Text perf test to be colocated within Rich Text directory --- packages/react-native-editor/package.json | 4 ++-- .../src/test}/rich-text.perf-native.js | 21 +++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) rename {test/native => packages/rich-text/src/test}/rich-text.perf-native.js (80%) diff --git a/packages/react-native-editor/package.json b/packages/react-native-editor/package.json index d7a694fa592c6..05323bf467cb1 100644 --- a/packages/react-native-editor/package.json +++ b/packages/react-native-editor/package.json @@ -108,8 +108,8 @@ "test": "cross-env NODE_ENV=test jest --verbose --config ../../test/native/jest.config.js", "test:debug": "cross-env NODE_ENV=test node --inspect-brk ../../node_modules/.bin/jest --runInBand --verbose --config ../../test/native/jest.config.js", "test:update": "npm run test -- --updateSnapshot", - "test:perf": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"/**/*.perf-native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure", - "test:perf:baseline": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"/**/*.perf-native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure --baseline", + "test:perf": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"**/*.perf-native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure", + "test:perf:baseline": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"**/*.perf-native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure --baseline", "device-tests": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=3 --testPathIgnorePatterns='canary|gutenberg-editor-rendering' --verbose --config ./jest_ui.config.js", "device-tests-canary": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=2 --testPathPattern=@canary --verbose --config ./jest_ui.config.js", "device-tests:local": "cross-env NODE_ENV=test jest --runInBand --detectOpenHandles --verbose --forceExit --config ./jest_ui.config.js", diff --git a/test/native/rich-text.perf-native.js b/packages/rich-text/src/test/rich-text.perf-native.js similarity index 80% rename from test/native/rich-text.perf-native.js rename to packages/rich-text/src/test/rich-text.perf-native.js index a1c37b680dd32..f4446f72997de 100644 --- a/test/native/rich-text.perf-native.js +++ b/packages/rich-text/src/test/rich-text.perf-native.js @@ -11,7 +11,12 @@ import { /** * WordPress dependencies */ -import { RichText } from '@wordpress/block-editor'; +import { + BottomSheetSettings, + BlockEdit, + RichText, +} from '@wordpress/block-editor'; +import { SlotFillProvider } from '@wordpress/components'; describe( 'RichText Performance', () => { it( 'performance is stable when typing rich text', async () => { @@ -26,7 +31,19 @@ describe( 'RichText Performance', () => { ); }; - await measurePerformance( , { + const EditorTree = ( props ) => ( + + + + + ); + + await measurePerformance( EditorTree, { scenario, } ); } ); From 80b345d51c28605fd6cb7dbe86f5906055177ed1 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 23 Mar 2023 14:00:02 +1000 Subject: [PATCH 25/37] Remove failing Rich Text perf tests --- .../src/test/rich-text.perf-native.js | 51 +------------------ 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/packages/rich-text/src/test/rich-text.perf-native.js b/packages/rich-text/src/test/rich-text.perf-native.js index f4446f72997de..a7d019a1f0f3b 100644 --- a/packages/rich-text/src/test/rich-text.perf-native.js +++ b/packages/rich-text/src/test/rich-text.perf-native.js @@ -11,12 +11,7 @@ import { /** * WordPress dependencies */ -import { - BottomSheetSettings, - BlockEdit, - RichText, -} from '@wordpress/block-editor'; -import { SlotFillProvider } from '@wordpress/components'; +import { RichText } from '@wordpress/block-editor'; describe( 'RichText Performance', () => { it( 'performance is stable when typing rich text', async () => { @@ -31,19 +26,7 @@ describe( 'RichText Performance', () => { ); }; - const EditorTree = ( props ) => ( - - - - - ); - - await measurePerformance( EditorTree, { + await measurePerformance( , { scenario, } ); } ); @@ -59,34 +42,4 @@ describe( 'RichText Performance', () => { scenario, } ); } ); - - it( 'performance is stable when text input is blurred', async () => { - const scenario = async () => { - const richTextInput = screen.getByLabelText( 'Text input. Empty' ); - - fireEvent( richTextInput, 'blur' ); - }; - - await measurePerformance( , { - scenario, - } ); - } ); - - it( 'performance is stable when text is selected', async () => { - const scenario = async () => { - const richTextInput = screen.getByLabelText( 'Text input. Empty' ); - - const selection = { start: 2, end: 4 }; - fireEvent( richTextInput, 'selectionChange', 2, 4, 'Hello', { - nativeEvent: { selection, text: 'Hello' }, - } ); - }; - - await measurePerformance( - , - { - scenario, - } - ); - } ); } ); From 0bf3494322a838293763cb224994367e52bb809f Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 23 Mar 2023 17:42:32 +1000 Subject: [PATCH 26/37] Update Rich Text performance test to remove duplicate test case --- .../rich-text/src/test/rich-text.perf-native.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/rich-text/src/test/rich-text.perf-native.js b/packages/rich-text/src/test/rich-text.perf-native.js index a7d019a1f0f3b..a489a79ef8fde 100644 --- a/packages/rich-text/src/test/rich-text.perf-native.js +++ b/packages/rich-text/src/test/rich-text.perf-native.js @@ -14,7 +14,7 @@ import { import { RichText } from '@wordpress/block-editor'; describe( 'RichText Performance', () => { - it( 'performance is stable when typing rich text', async () => { + it( 'performance is stable when typing using Rich Text', async () => { const scenario = async () => { const richTextInput = screen.getByLabelText( 'Text input. Empty' ); @@ -30,16 +30,4 @@ describe( 'RichText Performance', () => { scenario, } ); } ); - - it( 'performance is stable when text input is focused', async () => { - const scenario = async () => { - const richTextInput = screen.getByLabelText( 'Text input. Empty' ); - - fireEvent( richTextInput, 'focus' ); - }; - - await measurePerformance( , { - scenario, - } ); - } ); } ); From 3903b6ff635c5693386a0fe8f5698e4aa39d14e0 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 23 Mar 2023 17:43:00 +1000 Subject: [PATCH 27/37] Add Paragraph performance test case --- .../paragraph/test/paragraph.perf-native.js | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 packages/block-library/src/paragraph/test/paragraph.perf-native.js diff --git a/packages/block-library/src/paragraph/test/paragraph.perf-native.js b/packages/block-library/src/paragraph/test/paragraph.perf-native.js new file mode 100644 index 0000000000000..a19a18ed87dd2 --- /dev/null +++ b/packages/block-library/src/paragraph/test/paragraph.perf-native.js @@ -0,0 +1,38 @@ +/** + * External dependencies + */ +import { fireEvent, measurePerformance, screen } from 'test/helpers'; + +/** + * WordPress dependencies + */ +/** + * Internal dependencies + */ +import Paragraph from '../edit'; + +describe( 'RichText Performance', () => { + it( 'performance is stable when typing text using the Paragraph block', async () => { + const scenario = async () => { + const paragraph = screen.getByPlaceholderText( 'Start writing…' ); + + fireEvent( paragraph, 'focus' ); + fireEvent.changeText( + paragraph, + 'Bold italic strikethrough text' + ); + }; + + await measurePerformance( + , + { + scenario, + } + ); + } ); +} ); From d281bae51f8fa815c3f3a3e172ef60c834550cf5 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Mon, 27 Mar 2023 13:23:39 +1000 Subject: [PATCH 28/37] Move perf-native.js tests to colocated performance directory --- .../paragraph/test/{ => performance}/paragraph.perf-native.js | 2 +- .../src/test/{ => performance}/rich-text.perf-native.js | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/block-library/src/paragraph/test/{ => performance}/paragraph.perf-native.js (95%) rename packages/rich-text/src/test/{ => performance}/rich-text.perf-native.js (100%) diff --git a/packages/block-library/src/paragraph/test/paragraph.perf-native.js b/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js similarity index 95% rename from packages/block-library/src/paragraph/test/paragraph.perf-native.js rename to packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js index a19a18ed87dd2..db27be26855ee 100644 --- a/packages/block-library/src/paragraph/test/paragraph.perf-native.js +++ b/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js @@ -9,7 +9,7 @@ import { fireEvent, measurePerformance, screen } from 'test/helpers'; /** * Internal dependencies */ -import Paragraph from '../edit'; +import Paragraph from '../../edit'; describe( 'RichText Performance', () => { it( 'performance is stable when typing text using the Paragraph block', async () => { diff --git a/packages/rich-text/src/test/rich-text.perf-native.js b/packages/rich-text/src/test/performance/rich-text.perf-native.js similarity index 100% rename from packages/rich-text/src/test/rich-text.perf-native.js rename to packages/rich-text/src/test/performance/rich-text.perf-native.js From ccc918c5035ea009575e43d2f06acaf9d703c16d Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Mon, 27 Mar 2023 13:28:01 +1000 Subject: [PATCH 29/37] Remove unnecessary import declaration --- .../src/paragraph/test/performance/paragraph.perf-native.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js b/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js index db27be26855ee..893ab9bef4055 100644 --- a/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js +++ b/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js @@ -3,9 +3,6 @@ */ import { fireEvent, measurePerformance, screen } from 'test/helpers'; -/** - * WordPress dependencies - */ /** * Internal dependencies */ From 9f5b5143388f68012fe8f36eb23bcbcf240e0786 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Mon, 27 Mar 2023 13:29:13 +1000 Subject: [PATCH 30/37] Remove reassure-tests.sh CI script --- bin/reassure-tests.sh | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100755 bin/reassure-tests.sh diff --git a/bin/reassure-tests.sh b/bin/reassure-tests.sh deleted file mode 100755 index 5bf323d1509c8..0000000000000 --- a/bin/reassure-tests.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Move out of bin directory to Gutenberg project root -cd ../ - -BASELINE_BRANCH=${BASELINE_BRANCH:="trunk"} - -# Required for `git switch` on CI -git fetch origin - -# Gather baseline perf measurements -git switch "$BASELINE_BRANCH" -npm --cwd ci --force -npm run native test:perf --baseline - -# Gather current perf measurements & compare results -git switch --detach - -npm ci --force -npm run native test:perf \ No newline at end of file From 31885b5956c51be262062c39d86c9aadff1e2d3d Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Mon, 27 Mar 2023 13:58:29 +1000 Subject: [PATCH 31/37] Update Paragraph Reassure performance test description --- .../src/paragraph/test/performance/paragraph.perf-native.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js b/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js index 893ab9bef4055..2730c3df66b64 100644 --- a/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js +++ b/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js @@ -8,8 +8,8 @@ import { fireEvent, measurePerformance, screen } from 'test/helpers'; */ import Paragraph from '../../edit'; -describe( 'RichText Performance', () => { - it( 'performance is stable when typing text using the Paragraph block', async () => { +describe( 'Paragraph', () => { + it( 'performance is stable when typing text', async () => { const scenario = async () => { const paragraph = screen.getByPlaceholderText( 'Start writing…' ); From 222fd2be678e80fed1bab7b99bd207ca76e3b6c0 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Mon, 27 Mar 2023 16:38:13 +1000 Subject: [PATCH 32/37] Update Rich Text performance test import and props --- .../test/performance/rich-text.perf-native.js | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/rich-text/src/test/performance/rich-text.perf-native.js b/packages/rich-text/src/test/performance/rich-text.perf-native.js index a489a79ef8fde..0d2425adc56ed 100644 --- a/packages/rich-text/src/test/performance/rich-text.perf-native.js +++ b/packages/rich-text/src/test/performance/rich-text.perf-native.js @@ -9,11 +9,15 @@ import { } from 'test/helpers'; /** - * WordPress dependencies + * Internal dependencies */ -import { RichText } from '@wordpress/block-editor'; +import RichText from '../../component/index.native'; describe( 'RichText Performance', () => { + const onCreateUndoLevel = jest.fn(); + const onChange = jest.fn(); + const onSelectionChange = jest.fn(); + it( 'performance is stable when typing using Rich Text', async () => { const scenario = async () => { const richTextInput = screen.getByLabelText( 'Text input. Empty' ); @@ -26,8 +30,15 @@ describe( 'RichText Performance', () => { ); }; - await measurePerformance( , { - scenario, - } ); + await measurePerformance( + , + { + scenario, + } + ); } ); } ); From 75e7653bf492c570042b86110f1fb569b255529b Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 28 Mar 2023 13:01:36 +1000 Subject: [PATCH 33/37] Remove unused props from Paragraph Reassure performance test --- .../paragraph/test/performance/paragraph.perf-native.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js b/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js index 2730c3df66b64..17e712afbab8e 100644 --- a/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js +++ b/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js @@ -21,12 +21,7 @@ describe( 'Paragraph', () => { }; await measurePerformance( - , + , { scenario, } From 3e96479fbd9d4728e447e7e4a417c2b46a01ed29 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 28 Mar 2023 13:23:48 +1000 Subject: [PATCH 34/37] Drop the perf-* prefix from Reassure performance test extensions --- .../performance/{paragraph.perf-native.js => paragraph.native.js} | 0 .../performance/{rich-text.perf-native.js => rich-text.native.js} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename packages/block-library/src/paragraph/test/performance/{paragraph.perf-native.js => paragraph.native.js} (100%) rename packages/rich-text/src/test/performance/{rich-text.perf-native.js => rich-text.native.js} (100%) diff --git a/packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js b/packages/block-library/src/paragraph/test/performance/paragraph.native.js similarity index 100% rename from packages/block-library/src/paragraph/test/performance/paragraph.perf-native.js rename to packages/block-library/src/paragraph/test/performance/paragraph.native.js diff --git a/packages/rich-text/src/test/performance/rich-text.perf-native.js b/packages/rich-text/src/test/performance/rich-text.native.js similarity index 100% rename from packages/rich-text/src/test/performance/rich-text.perf-native.js rename to packages/rich-text/src/test/performance/rich-text.native.js From 923844cfb53896f1a659c77607d32fc58812bedd Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 28 Mar 2023 17:45:21 +1000 Subject: [PATCH 35/37] Update Reassure script test paths --- packages/react-native-editor/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native-editor/package.json b/packages/react-native-editor/package.json index 05323bf467cb1..5a63d35847544 100644 --- a/packages/react-native-editor/package.json +++ b/packages/react-native-editor/package.json @@ -108,8 +108,8 @@ "test": "cross-env NODE_ENV=test jest --verbose --config ../../test/native/jest.config.js", "test:debug": "cross-env NODE_ENV=test node --inspect-brk ../../node_modules/.bin/jest --runInBand --verbose --config ../../test/native/jest.config.js", "test:update": "npm run test -- --updateSnapshot", - "test:perf": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"**/*.perf-native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure", - "test:perf:baseline": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"**/*.perf-native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure --baseline", + "test:perf": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"**/performance/*.native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure", + "test:perf:baseline": "cross-env NODE_ENV=test TEST_RUNNER_PATH=../../node_modules/.bin/jest TEST_RUNNER_ARGS='--runInBand --testMatch \"**/performance/*.native.[jt]s?(x)\" --verbose --config ../../test/native/jest.config.js' reassure --baseline", "device-tests": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=3 --testPathIgnorePatterns='canary|gutenberg-editor-rendering' --verbose --config ./jest_ui.config.js", "device-tests-canary": "cross-env NODE_ENV=test jest --forceExit --detectOpenHandles --no-cache --maxWorkers=2 --testPathPattern=@canary --verbose --config ./jest_ui.config.js", "device-tests:local": "cross-env NODE_ENV=test jest --runInBand --detectOpenHandles --verbose --forceExit --config ./jest_ui.config.js", From fb74782f1ae5f6deea768a7f1ba0bc47de92ace9 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 4 Apr 2023 09:04:18 +1000 Subject: [PATCH 36/37] Remove Paragraph performance test --- .../test/performance/paragraph.native.js | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 packages/block-library/src/paragraph/test/performance/paragraph.native.js diff --git a/packages/block-library/src/paragraph/test/performance/paragraph.native.js b/packages/block-library/src/paragraph/test/performance/paragraph.native.js deleted file mode 100644 index 17e712afbab8e..0000000000000 --- a/packages/block-library/src/paragraph/test/performance/paragraph.native.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * External dependencies - */ -import { fireEvent, measurePerformance, screen } from 'test/helpers'; - -/** - * Internal dependencies - */ -import Paragraph from '../../edit'; - -describe( 'Paragraph', () => { - it( 'performance is stable when typing text', async () => { - const scenario = async () => { - const paragraph = screen.getByPlaceholderText( 'Start writing…' ); - - fireEvent( paragraph, 'focus' ); - fireEvent.changeText( - paragraph, - 'Bold italic strikethrough text' - ); - }; - - await measurePerformance( - , - { - scenario, - } - ); - } ); -} ); From 5468ec06ea30b0575e8f6f01c39e1edc19700707 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Wed, 5 Apr 2023 12:33:11 +1000 Subject: [PATCH 37/37] Fix prop name in Rich Text native perf test --- packages/rich-text/src/test/performance/rich-text.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rich-text/src/test/performance/rich-text.native.js b/packages/rich-text/src/test/performance/rich-text.native.js index 0d2425adc56ed..faa76e9d5bff9 100644 --- a/packages/rich-text/src/test/performance/rich-text.native.js +++ b/packages/rich-text/src/test/performance/rich-text.native.js @@ -33,7 +33,7 @@ describe( 'RichText Performance', () => { await measurePerformance( , {