From fcb5a06c9d556d51bf5b5e4690644df1e81db54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 22 May 2023 14:51:15 +0200 Subject: [PATCH 01/34] feat: add sample Sidebar performance test --- package-lock.json | 25 +++++++++++++------------ package.json | 1 + 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 43f750e09267..f470da05912e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -172,6 +172,7 @@ "react-test-renderer": "18.1.0", "reassure": "^0.9.0", "setimmediate": "^1.0.5", + "reassure": "^0.9.0", "shellcheck": "^1.1.0", "style-loader": "^2.0.0", "time-analytics-webpack-plugin": "^0.1.17", @@ -2043,9 +2044,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.22.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.3.tgz", - "integrity": "sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", + "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", "dependencies": { "regenerator-runtime": "^0.13.11" }, @@ -38905,9 +38906,9 @@ "license": "ISC" }, "node_modules/simple-git": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.19.0.tgz", - "integrity": "sha512-hyH2p9Ptxjf/xPuL7HfXbpYt9gKhC1yWDh3KYIAYJJePAKV7AEjLN4xhp7lozOdNiaJ9jlVvAbBymVlcS2jRiA==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.18.0.tgz", + "integrity": "sha512-Yt0GJ5aYrpPci3JyrYcsPz8Xc05Hi4JPSOb+Sgn/BmPX35fn/6Fp9Mef8eMBCrL2siY5w4j49TA5Q+bxPpri1Q==", "dev": true, "dependencies": { "@kwsites/file-exists": "^1.1.1", @@ -44232,9 +44233,9 @@ } }, "@babel/runtime": { - "version": "7.22.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.3.tgz", - "integrity": "sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", + "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", "requires": { "regenerator-runtime": "^0.13.11" } @@ -69202,9 +69203,9 @@ "version": "3.0.7" }, "simple-git": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.19.0.tgz", - "integrity": "sha512-hyH2p9Ptxjf/xPuL7HfXbpYt9gKhC1yWDh3KYIAYJJePAKV7AEjLN4xhp7lozOdNiaJ9jlVvAbBymVlcS2jRiA==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.18.0.tgz", + "integrity": "sha512-Yt0GJ5aYrpPci3JyrYcsPz8Xc05Hi4JPSOb+Sgn/BmPX35fn/6Fp9Mef8eMBCrL2siY5w4j49TA5Q+bxPpri1Q==", "dev": true, "requires": { "@kwsites/file-exists": "^1.1.1", diff --git a/package.json b/package.json index 9b6b582915e1..8541a0e127b6 100644 --- a/package.json +++ b/package.json @@ -207,6 +207,7 @@ "react-test-renderer": "18.1.0", "reassure": "^0.9.0", "setimmediate": "^1.0.5", + "reassure": "^0.9.0", "shellcheck": "^1.1.0", "style-loader": "^2.0.0", "time-analytics-webpack-plugin": "^0.1.17", From 83a24cb531cca07f28eee27927cef8352749336e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 29 May 2023 13:52:17 +0200 Subject: [PATCH 02/34] feat: ci setup --- .../composite/performanceTesting/action.yml | 32 +++++++++++++++++++ package-lock.json | 31 +++++++++++++++++- package.json | 1 - 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 .github/actions/composite/performanceTesting/action.yml diff --git a/.github/actions/composite/performanceTesting/action.yml b/.github/actions/composite/performanceTesting/action.yml new file mode 100644 index 000000000000..5561f08563de --- /dev/null +++ b/.github/actions/composite/performanceTesting/action.yml @@ -0,0 +1,32 @@ +name: reassure-tests + +inputs: + OS_BOTIFY_TOKEN: + description: GitHub token for OSBotify + required: true + +on: + push: + branches: [main] + pull_request: + branches: ['**'] + +jobs: + steps: + - name: Run performance testing script + shell: bash + run: | + set -e + BASELINE_BRANCH=${BASELINE_BRANCH:="main"} + git fetch origin + git switch "$BASELINE_BRANCH" + yarn install --force + yarn reassure --baseline + git switch --detach - + yarn install --force + yarn reassure --branch + + - name: Run Danger.js + run: yarn danger ci + env: + GITHUB_TOKEN: ${{ inputs.OS_BOTIFY_TOKEN }} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f470da05912e..be3d7105145f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -172,7 +172,6 @@ "react-test-renderer": "18.1.0", "reassure": "^0.9.0", "setimmediate": "^1.0.5", - "reassure": "^0.9.0", "shellcheck": "^1.1.0", "style-loader": "^2.0.0", "time-analytics-webpack-plugin": "^0.1.17", @@ -26408,6 +26407,15 @@ "which": "bin/which" } }, + "node_modules/hyperlinker": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hyperlinker/-/hyperlinker-1.0.0.tgz", + "integrity": "sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/hyphenate-style-name": { "version": "1.0.4", "license": "BSD-3-Clause" @@ -37489,6 +37497,15 @@ "resolved": "https://registry.npmjs.org/readline/-/readline-1.3.0.tgz", "integrity": "sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==" }, + "node_modules/readline-sync": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", + "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/reassure": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/reassure/-/reassure-0.9.0.tgz", @@ -60858,6 +60875,12 @@ } } }, + "hyperlinker": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hyperlinker/-/hyperlinker-1.0.0.tgz", + "integrity": "sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ==", + "dev": true + }, "hyphenate-style-name": { "version": "1.0.4" }, @@ -68236,6 +68259,12 @@ "resolved": "https://registry.npmjs.org/readline/-/readline-1.3.0.tgz", "integrity": "sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==" }, + "readline-sync": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", + "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", + "dev": true + }, "reassure": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/reassure/-/reassure-0.9.0.tgz", diff --git a/package.json b/package.json index 8541a0e127b6..9b6b582915e1 100644 --- a/package.json +++ b/package.json @@ -207,7 +207,6 @@ "react-test-renderer": "18.1.0", "reassure": "^0.9.0", "setimmediate": "^1.0.5", - "reassure": "^0.9.0", "shellcheck": "^1.1.0", "style-loader": "^2.0.0", "time-analytics-webpack-plugin": "^0.1.17", From 3eda7b74f49be9a7e39581d7a80346265fc46a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 29 May 2023 14:41:00 +0200 Subject: [PATCH 03/34] move gh action to workflows --- .../composite/performanceTesting/action.yml | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 .github/actions/composite/performanceTesting/action.yml diff --git a/.github/actions/composite/performanceTesting/action.yml b/.github/actions/composite/performanceTesting/action.yml deleted file mode 100644 index 5561f08563de..000000000000 --- a/.github/actions/composite/performanceTesting/action.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: reassure-tests - -inputs: - OS_BOTIFY_TOKEN: - description: GitHub token for OSBotify - required: true - -on: - push: - branches: [main] - pull_request: - branches: ['**'] - -jobs: - steps: - - name: Run performance testing script - shell: bash - run: | - set -e - BASELINE_BRANCH=${BASELINE_BRANCH:="main"} - git fetch origin - git switch "$BASELINE_BRANCH" - yarn install --force - yarn reassure --baseline - git switch --detach - - yarn install --force - yarn reassure --branch - - - name: Run Danger.js - run: yarn danger ci - env: - GITHUB_TOKEN: ${{ inputs.OS_BOTIFY_TOKEN }} \ No newline at end of file From 88fa7a8cc390ccf7ac8f1d582a0c5df282bf2fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 29 May 2023 14:41:37 +0200 Subject: [PATCH 04/34] nit: rename ci gh action --- .../workflows/reassurePerformanceTests.yml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/reassurePerformanceTests.yml diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml new file mode 100644 index 000000000000..1bf43280ba89 --- /dev/null +++ b/.github/workflows/reassurePerformanceTests.yml @@ -0,0 +1,32 @@ +name: Reassure Performance Tests + +inputs: + OS_BOTIFY_TOKEN: + description: GitHub token for OSBotify + required: true + +on: + push: + branches: [main] + pull_request: + branches: ['**'] + +jobs: + steps: + - name: Run performance testing script + shell: bash + run: | + set -e + BASELINE_BRANCH=${BASELINE_BRANCH:="main"} + git fetch origin + git switch "$BASELINE_BRANCH" + yarn install --force + yarn reassure --baseline + git switch --detach - + yarn install --force + yarn reassure --branch + + - name: Run Danger.js + run: yarn danger ci + env: + GITHUB_TOKEN: ${{ inputs.OS_BOTIFY_TOKEN }} \ No newline at end of file From 51e1b4ce08498ad57fcd26eb394355b70c676d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 29 May 2023 14:51:55 +0200 Subject: [PATCH 05/34] fix: ci workflow file --- .../workflows/reassurePerformanceTests.yml | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 1bf43280ba89..dbe91dff6024 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -12,21 +12,23 @@ on: branches: ['**'] jobs: - steps: - - name: Run performance testing script - shell: bash - run: | - set -e - BASELINE_BRANCH=${BASELINE_BRANCH:="main"} - git fetch origin - git switch "$BASELINE_BRANCH" - yarn install --force - yarn reassure --baseline - git switch --detach - - yarn install --force - yarn reassure --branch + perf-tests: + runs-on: ubuntu-latest + steps: + - name: Run performance testing script + shell: bash + run: | + set -e + BASELINE_BRANCH=${BASELINE_BRANCH:="main"} + git fetch origin + git switch "$BASELINE_BRANCH" + yarn install --force + yarn reassure --baseline + git switch --detach - + yarn install --force + yarn reassure --branch - - name: Run Danger.js - run: yarn danger ci - env: - GITHUB_TOKEN: ${{ inputs.OS_BOTIFY_TOKEN }} \ No newline at end of file + - name: Run Danger.js + run: yarn danger ci + env: + GITHUB_TOKEN: ${{ inputs.OS_BOTIFY_TOKEN }} \ No newline at end of file From 2f915e8d54900b6f143a91feb52fe96d46b8c18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 29 May 2023 15:59:29 +0200 Subject: [PATCH 06/34] fix: ci secret botify token --- .github/workflows/reassurePerformanceTests.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index dbe91dff6024..7dee21d90b23 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -1,10 +1,5 @@ name: Reassure Performance Tests -inputs: - OS_BOTIFY_TOKEN: - description: GitHub token for OSBotify - required: true - on: push: branches: [main] @@ -31,4 +26,4 @@ jobs: - name: Run Danger.js run: yarn danger ci env: - GITHUB_TOKEN: ${{ inputs.OS_BOTIFY_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} \ No newline at end of file From 4b51288d6bff421daa3699221a89f373593edd1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 30 May 2023 09:32:18 +0200 Subject: [PATCH 07/34] fix: eof, remove set -e --- .github/workflows/reassurePerformanceTests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 7dee21d90b23..3ee877ff8bae 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -13,7 +13,6 @@ jobs: - name: Run performance testing script shell: bash run: | - set -e BASELINE_BRANCH=${BASELINE_BRANCH:="main"} git fetch origin git switch "$BASELINE_BRANCH" @@ -26,4 +25,4 @@ jobs: - name: Run Danger.js run: yarn danger ci env: - GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} From a5b0c8c957154ab56877a0469df617c1c26d229b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 30 May 2023 09:52:09 +0200 Subject: [PATCH 08/34] refactor: switch yarn to npm --- .github/workflows/reassurePerformanceTests.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 3ee877ff8bae..4aa47c372f73 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -13,16 +13,17 @@ jobs: - name: Run performance testing script shell: bash run: | + set -e BASELINE_BRANCH=${BASELINE_BRANCH:="main"} git fetch origin git switch "$BASELINE_BRANCH" - yarn install --force - yarn reassure --baseline + npm install --force + npm run reassure --baseline git switch --detach - - yarn install --force - yarn reassure --branch + npm install --force + npm run reassure --branch - name: Run Danger.js - run: yarn danger ci + run: npm run danger ci env: GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} From e83c0b1ce234b3339d268d61a9289ecf4821f9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 30 May 2023 12:11:56 +0200 Subject: [PATCH 09/34] refactor: add checkout and setup nodejs --- .github/workflows/reassurePerformanceTests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 4aa47c372f73..42a18e9eadd5 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -10,8 +10,13 @@ jobs: perf-tests: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + + - name: Setup NodeJS + uses: Expensify/App/.github/actions/composite/setupNode@main + - name: Run performance testing script - shell: bash run: | set -e BASELINE_BRANCH=${BASELINE_BRANCH:="main"} From 55c85bf640dc698390a22ae736e92c58c9d9a043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 30 May 2023 12:14:55 +0200 Subject: [PATCH 10/34] fix: replace npm run with npx --- .github/workflows/reassurePerformanceTests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 42a18e9eadd5..cf706f463f09 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -23,12 +23,12 @@ jobs: git fetch origin git switch "$BASELINE_BRANCH" npm install --force - npm run reassure --baseline + npx reassure --baseline git switch --detach - npm install --force - npm run reassure --branch + npx reassure --branch - name: Run Danger.js - run: npm run danger ci + run: npx danger ci env: GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} From e81cec7f71c4517ad1aaff1e64daa0e6dab6fdaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 30 May 2023 12:17:06 +0200 Subject: [PATCH 11/34] fix: use shell bash --- .github/workflows/reassurePerformanceTests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index cf706f463f09..b6b2844b8a44 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -17,6 +17,7 @@ jobs: uses: Expensify/App/.github/actions/composite/setupNode@main - name: Run performance testing script + shell: bash run: | set -e BASELINE_BRANCH=${BASELINE_BRANCH:="main"} From 540df23ab37af017f881018b0c400d2a11c3c241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 30 May 2023 13:59:06 +0200 Subject: [PATCH 12/34] refactor: rename env var name --- .github/workflows/reassurePerformanceTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index b6b2844b8a44..23b3d32892bc 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -32,4 +32,4 @@ jobs: - name: Run Danger.js run: npx danger ci env: - GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} + DANGER_GITHUB_API_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} From 7919570a43776420323b2da8d6f8d62002ef23ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 30 May 2023 14:21:06 +0200 Subject: [PATCH 13/34] fix: test danger with GITHUB_TOKEN --- .github/workflows/reassurePerformanceTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 23b3d32892bc..8b9e4573dbdc 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -32,4 +32,4 @@ jobs: - name: Run Danger.js run: npx danger ci env: - DANGER_GITHUB_API_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 21a2b5858e12d6a4786cf6bb053cf7e6fcfcf67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Wed, 31 May 2023 15:23:38 +0200 Subject: [PATCH 14/34] feat: add comment workflow --- .github/workflows/reassurePerformanceTests.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 8b9e4573dbdc..203b796ef3b5 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -29,7 +29,9 @@ jobs: npm install --force npx reassure --branch - - name: Run Danger.js - run: npx danger ci - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Add comment to PR + uses: peter-evans/create-or-update-comment@v3 + with: + token: ${{ secrets.OS_BOTIFY_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body-path: '.reassure/output.md' From c0350380da6537ca9620d2b1730c3b6a63410785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Wed, 31 May 2023 15:38:29 +0200 Subject: [PATCH 15/34] feat: set default token --- .github/workflows/reassurePerformanceTests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 203b796ef3b5..481e0905aa7c 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -32,6 +32,5 @@ jobs: - name: Add comment to PR uses: peter-evans/create-or-update-comment@v3 with: - token: ${{ secrets.OS_BOTIFY_TOKEN }} issue-number: ${{ github.event.pull_request.number }} body-path: '.reassure/output.md' From d557f57521caf693f7da1d728136615116d01891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Thu, 1 Jun 2023 13:03:32 +0200 Subject: [PATCH 16/34] refactor: use existing comment action --- .github/workflows/reassurePerformanceTests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 481e0905aa7c..574d3ded015c 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -30,7 +30,8 @@ jobs: npx reassure --branch - name: Add comment to PR - uses: peter-evans/create-or-update-comment@v3 + uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac with: - issue-number: ${{ github.event.pull_request.number }} - body-path: '.reassure/output.md' + github_token: ${{ secrets.OS_BOTIFY_TOKEN }} + number: ${{ github.event.pull_request.number }} + body-file: '.reassure/output.md' From 5a4a9411b56fa62b6b71afe7a6e145ec9a560d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Thu, 1 Jun 2023 13:38:19 +0200 Subject: [PATCH 17/34] fix: change body-file to body as input --- .github/workflows/reassurePerformanceTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 574d3ded015c..09d7f10398a1 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -34,4 +34,4 @@ jobs: with: github_token: ${{ secrets.OS_BOTIFY_TOKEN }} number: ${{ github.event.pull_request.number }} - body-file: '.reassure/output.md' + body: ${{ readFile('.reassure/output.md') }} From e0dfcdfd7cc39b4c9f36d265dcf467bcbe47304e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Thu, 1 Jun 2023 13:44:23 +0200 Subject: [PATCH 18/34] feat: add custom read file action --- .github/workflows/reassurePerformanceTests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 09d7f10398a1..bed6601f0b7a 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -29,9 +29,15 @@ jobs: npm install --force npx reassure --branch + - name: Read output.md + id: reassure + uses: juliangruber/read-file-action@v1 + with: + path: .reassure/output.md + - name: Add comment to PR uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac with: github_token: ${{ secrets.OS_BOTIFY_TOKEN }} number: ${{ github.event.pull_request.number }} - body: ${{ readFile('.reassure/output.md') }} + body: ${{ steps.reassure.outputs.content }} \ No newline at end of file From c1439f797b338a29ebc236b865d748d4dc0e8d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Thu, 1 Jun 2023 15:51:01 +0200 Subject: [PATCH 19/34] refactor: cr --- .github/workflows/reassurePerformanceTests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index bed6601f0b7a..e794615bf3f1 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -38,6 +38,5 @@ jobs: - name: Add comment to PR uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac with: - github_token: ${{ secrets.OS_BOTIFY_TOKEN }} - number: ${{ github.event.pull_request.number }} - body: ${{ steps.reassure.outputs.content }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} + body: ${{ steps.reassure.outputs.content }} From bc16c47b3477be0f587aa8dc58c5939d6e2de3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Thu, 1 Jun 2023 16:15:44 +0200 Subject: [PATCH 20/34] revert: github_token name --- .github/workflows/reassurePerformanceTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index e794615bf3f1..4f172dc3f837 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -38,5 +38,5 @@ jobs: - name: Add comment to PR uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac with: - GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} + github_token: ${{ secrets.OS_BOTIFY_TOKEN }} body: ${{ steps.reassure.outputs.content }} From daaea2d56443b592a2227c5f00a3d093df5afb4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 5 Jun 2023 13:09:49 +0200 Subject: [PATCH 21/34] test: regression --- tests/perf-test/SidebarLinks.perf-test.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/perf-test/SidebarLinks.perf-test.js b/tests/perf-test/SidebarLinks.perf-test.js index eb2a243d1c06..2f95fc3e72c9 100644 --- a/tests/perf-test/SidebarLinks.perf-test.js +++ b/tests/perf-test/SidebarLinks.perf-test.js @@ -1,5 +1,6 @@ import {measurePerformance} from 'reassure'; import Onyx from 'react-native-onyx'; +import React from 'react'; import _ from 'underscore'; import * as LHNTestUtils from '../utils/LHNTestUtils'; import CONST from '../../src/CONST'; @@ -45,6 +46,17 @@ test('simple Sidebar render with hundred of reports', () => { }); const mockOnyxReports = _.assign({}, ...mockReports); + const TestRegression = () => { + const [render, setRender] = React.useState([]); + + React.useEffect(() => { + setRender(r => r + 1) + },[]) + + return + + } + return waitForPromisesToResolve() .then(() => Onyx.multiSet({ @@ -53,5 +65,5 @@ test('simple Sidebar render with hundred of reports', () => { ...mockOnyxReports, }), ) - .then(() => measurePerformance()); + .then(() => measurePerformance()); }); From 2a4d656e70cd060b53c9aa97dca563f99c8f30b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 5 Jun 2023 15:11:28 +0200 Subject: [PATCH 22/34] feat: add reassure validation gh workflow action --- .../workflows/reassurePerformanceTests.yml | 12 ++++++-- package-lock.json | 30 ------------------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index 4f172dc3f837..e850064d459a 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -29,11 +29,19 @@ jobs: npm install --force npx reassure --branch - - name: Read output.md + - name: Read output.json id: reassure uses: juliangruber/read-file-action@v1 with: - path: .reassure/output.md + path: .reassure/output.json + + - name: Validate output.json + id: validateReassureOutput + uses: ArekChr/App/.github/actions/javascript/validateReassureOutput@feat/reassure + with: + DURATION_DEVIATION_PERCENTAGE: 20 + COUNT_DEVIATION: 1 + REGRESSION_OUTPUT: ${{ steps.reassure.outputs.content }} - name: Add comment to PR uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac diff --git a/package-lock.json b/package-lock.json index be3d7105145f..40ed1ff7b11c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26407,15 +26407,6 @@ "which": "bin/which" } }, - "node_modules/hyperlinker": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hyperlinker/-/hyperlinker-1.0.0.tgz", - "integrity": "sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/hyphenate-style-name": { "version": "1.0.4", "license": "BSD-3-Clause" @@ -37497,15 +37488,6 @@ "resolved": "https://registry.npmjs.org/readline/-/readline-1.3.0.tgz", "integrity": "sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==" }, - "node_modules/readline-sync": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", - "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/reassure": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/reassure/-/reassure-0.9.0.tgz", @@ -60875,12 +60857,6 @@ } } }, - "hyperlinker": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hyperlinker/-/hyperlinker-1.0.0.tgz", - "integrity": "sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ==", - "dev": true - }, "hyphenate-style-name": { "version": "1.0.4" }, @@ -68259,12 +68235,6 @@ "resolved": "https://registry.npmjs.org/readline/-/readline-1.3.0.tgz", "integrity": "sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==" }, - "readline-sync": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", - "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", - "dev": true - }, "reassure": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/reassure/-/reassure-0.9.0.tgz", From b38b0b6594baabb7e89717b923799e53b7e6a1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 5 Jun 2023 15:44:43 +0200 Subject: [PATCH 23/34] fix: remove underscore import --- .../javascript/validateReassureOutput/index.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/actions/javascript/validateReassureOutput/index.js b/.github/actions/javascript/validateReassureOutput/index.js index 052f4529b0d5..d8d80e9ec9ef 100644 --- a/.github/actions/javascript/validateReassureOutput/index.js +++ b/.github/actions/javascript/validateReassureOutput/index.js @@ -1,14 +1,4 @@ -/** - * NOTE: This is a compiled file. DO NOT directly edit this file. - */ -module.exports = -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ 688: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const core = __nccwpck_require__(186); +const core = require('@actions/core'); const run = () => { const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true})); From 27572fa3b3f979cadab990f6b6a9afd1d8f430de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 5 Jun 2023 15:46:41 +0200 Subject: [PATCH 24/34] fix: prettier --- tests/perf-test/SidebarLinks.perf-test.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/perf-test/SidebarLinks.perf-test.js b/tests/perf-test/SidebarLinks.perf-test.js index 2f95fc3e72c9..15e10c6208f9 100644 --- a/tests/perf-test/SidebarLinks.perf-test.js +++ b/tests/perf-test/SidebarLinks.perf-test.js @@ -50,12 +50,11 @@ test('simple Sidebar render with hundred of reports', () => { const [render, setRender] = React.useState([]); React.useEffect(() => { - setRender(r => r + 1) - },[]) + setRender((r) => r + 1); + }, []); - return - - } + return ; + }; return waitForPromisesToResolve() .then(() => From d0e6323a659ea659a864d26ea0e87a54c08da0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Mon, 5 Jun 2023 16:02:20 +0200 Subject: [PATCH 25/34] fix: build actions --- .../validateReassureOutput/index.js | 18 +++++++++---- .../validateReassureOutput.js | 27 +++++++------------ 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/actions/javascript/validateReassureOutput/index.js b/.github/actions/javascript/validateReassureOutput/index.js index d8d80e9ec9ef..734b9bed271e 100644 --- a/.github/actions/javascript/validateReassureOutput/index.js +++ b/.github/actions/javascript/validateReassureOutput/index.js @@ -1,4 +1,14 @@ -const core = require('@actions/core'); +/** + * NOTE: This is a compiled file. DO NOT directly edit this file. + */ +module.exports = +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 688: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const core = __nccwpck_require__(186); const run = () => { const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true})); @@ -10,10 +20,8 @@ const run = () => { return true; } - console.log(`Processing ${regressionOutput.countChanged.length} measurements...`); - - for (let i = 0; i < regressionOutput.countChanged.length; i++) { - const measurement = regressionOutput.countChanged[i]; + for (let i; regressionOutput.countChanged.length > i; i++) { + const measurement = regressionOutput.countChanged[i] const baseline = measurement.baseline; const current = measurement.current; diff --git a/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js b/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js index da81d88c9885..4ffc1130e03b 100644 --- a/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js +++ b/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js @@ -1,43 +1,34 @@ const core = require('@actions/core'); const run = () => { - const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true})); + const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true})) const countDeviation = core.getInput('COUNT_DEVIATION', {required: true}); const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', {required: true}); - if (regressionOutput.countChanged === undefined || regressionOutput.countChanged.length === 0) { - console.log('No countChanged data available. Exiting...'); + if (regressionOutput.countChanged === undefined) { return true; } - console.log(`Processing ${regressionOutput.countChanged.length} measurements...`); - - for (let i = 0; i < regressionOutput.countChanged.length; i++) { - const measurement = regressionOutput.countChanged[i]; + for (let i; regressionOutput.countChanged.length > i; i++) { + const measurement = regressionOutput.countChanged[i] const baseline = measurement.baseline; const current = measurement.current; - console.log(`Processing measurement ${i + 1}: ${measurement.name}`); - - const renderCountDiff = current.meanCount - baseline.meanCount; - if (renderCountDiff > countDeviation) { - core.setFailed(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); + const renderCountDiff = current.meanCount - baseline.meanCount + if (renderCountDiff >= countDeviation) { + core.setFailed(`Render count difference exceeded the allowed deviation of ${countDeviation}, current: ${renderCountDiff}`); break; - } else { - console.log(`Render count difference ${renderCountDiff} is within the allowed deviation range of ${countDeviation}.`); } const increasePercentage = ((current.meanDuration - baseline.meanDuration) / baseline.meanDuration) * 100; if (increasePercentage > durationDeviation) { - core.setFailed(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%. Current percentage: ${increasePercentage}%`); + core.setFailed(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%, current: ${increasePercentage}%`); break; - } else { - console.log(`Duration increase percentage ${increasePercentage}% is within the allowed deviation range of ${durationDeviation}%.`); } } return true; -}; +} if (require.main === module) { run(); From c70692b7678529e3524ec078fc5e945cef17dc96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 6 Jun 2023 10:46:36 +0200 Subject: [PATCH 26/34] feat: add logging --- .../validateReassureOutput/index.js | 24 +++++++++++--- .../validateReassureOutput.js | 31 ++++++++++++++----- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/.github/actions/javascript/validateReassureOutput/index.js b/.github/actions/javascript/validateReassureOutput/index.js index 734b9bed271e..abb2160e2e0b 100644 --- a/.github/actions/javascript/validateReassureOutput/index.js +++ b/.github/actions/javascript/validateReassureOutput/index.js @@ -15,20 +15,31 @@ const run = () => { const countDeviation = core.getInput('COUNT_DEVIATION', {required: true}); const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', {required: true}); - if (regressionOutput.countChanged === undefined || regressionOutput.countChanged.length === 0) { + console.log('Input values:'); + console.log('REGRESSION_OUTPUT:', regressionOutput); + console.log('COUNT_DEVIATION:', countDeviation); + console.log('DURATION_DEVIATION_PERCENTAGE:', durationDeviation); + + if (regressionOutput.countChanged === undefined) { console.log('No countChanged data available. Exiting...'); return true; } - for (let i; regressionOutput.countChanged.length > i; i++) { - const measurement = regressionOutput.countChanged[i] + for (let i = 0; i < regressionOutput.countChanged.length; i++) { + const measurement = regressionOutput.countChanged[i]; const baseline = measurement.baseline; const current = measurement.current; - console.log(`Processing measurement ${i + 1}: ${measurement.name}`); + console.log(`Processing measurement ${i + 1}:`); + console.log('Measurement:', measurement); + console.log('Baseline:', baseline); + console.log('Current:', current); const renderCountDiff = current.meanCount - baseline.meanCount; - if (renderCountDiff > countDeviation) { + console.log('Render count difference:', renderCountDiff); + + if (renderCountDiff >= countDeviation) { + console.log(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); core.setFailed(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); break; } else { @@ -36,7 +47,10 @@ const run = () => { } const increasePercentage = ((current.meanDuration - baseline.meanDuration) / baseline.meanDuration) * 100; + console.log('Duration increase percentage:', increasePercentage); + if (increasePercentage > durationDeviation) { + console.log(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%. Current percentage: ${increasePercentage}%`); core.setFailed(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%. Current percentage: ${increasePercentage}%`); break; } else { diff --git a/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js b/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js index 4ffc1130e03b..612f4378c606 100644 --- a/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js +++ b/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js @@ -1,34 +1,51 @@ const core = require('@actions/core'); const run = () => { - const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true})) + const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true})); const countDeviation = core.getInput('COUNT_DEVIATION', {required: true}); const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', {required: true}); + console.log('Input values:'); + console.log('REGRESSION_OUTPUT:', regressionOutput); + console.log('COUNT_DEVIATION:', countDeviation); + console.log('DURATION_DEVIATION_PERCENTAGE:', durationDeviation); + if (regressionOutput.countChanged === undefined) { + console.log('No countChanged data available. Exiting...'); return true; } - for (let i; regressionOutput.countChanged.length > i; i++) { - const measurement = regressionOutput.countChanged[i] + for (let i = 0; i < regressionOutput.countChanged.length; i++) { + const measurement = regressionOutput.countChanged[i]; const baseline = measurement.baseline; const current = measurement.current; - const renderCountDiff = current.meanCount - baseline.meanCount + console.log(`Processing measurement ${i + 1}:`); + console.log('Measurement:', measurement); + console.log('Baseline:', baseline); + console.log('Current:', current); + + const renderCountDiff = current.meanCount - baseline.meanCount; + console.log('Render count difference:', renderCountDiff); + if (renderCountDiff >= countDeviation) { - core.setFailed(`Render count difference exceeded the allowed deviation of ${countDeviation}, current: ${renderCountDiff}`); + console.log(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); + core.setFailed(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); break; } const increasePercentage = ((current.meanDuration - baseline.meanDuration) / baseline.meanDuration) * 100; + console.log('Duration increase percentage:', increasePercentage); + if (increasePercentage > durationDeviation) { - core.setFailed(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%, current: ${increasePercentage}%`); + console.log(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%. Current percentage: ${increasePercentage}%`); + core.setFailed(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%. Current percentage: ${increasePercentage}%`); break; } } return true; -} +}; if (require.main === module) { run(); From cc234bb97262fb71db197f197384ff8e1ed42e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 6 Jun 2023 11:20:35 +0200 Subject: [PATCH 27/34] refactor: improve logging --- .../validateReassureOutput.js | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js b/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js index 612f4378c606..16c09e67a4b4 100644 --- a/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js +++ b/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js @@ -1,46 +1,38 @@ const core = require('@actions/core'); const run = () => { - const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true})); - const countDeviation = core.getInput('COUNT_DEVIATION', {required: true}); - const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', {required: true}); + const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', { required: true })); + const countDeviation = core.getInput('COUNT_DEVIATION', { required: true }); + const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', { required: true }); - console.log('Input values:'); - console.log('REGRESSION_OUTPUT:', regressionOutput); - console.log('COUNT_DEVIATION:', countDeviation); - console.log('DURATION_DEVIATION_PERCENTAGE:', durationDeviation); - - if (regressionOutput.countChanged === undefined) { + if (regressionOutput.countChanged === undefined || regressionOutput.countChanged.length === 0) { console.log('No countChanged data available. Exiting...'); return true; - } + } + + console.log(`Processing ${regressionOutput.countChanged.length} measurements...`); for (let i = 0; i < regressionOutput.countChanged.length; i++) { const measurement = regressionOutput.countChanged[i]; const baseline = measurement.baseline; const current = measurement.current; - console.log(`Processing measurement ${i + 1}:`); - console.log('Measurement:', measurement); - console.log('Baseline:', baseline); - console.log('Current:', current); + console.log(`Processing measurement ${i + 1}: ${measurement.name}`); const renderCountDiff = current.meanCount - baseline.meanCount; - console.log('Render count difference:', renderCountDiff); - if (renderCountDiff >= countDeviation) { - console.log(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); core.setFailed(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); break; + } else { + console.log(`Render count difference ${renderCountDiff} is within the allowed deviation range of ${countDeviation}.`); } const increasePercentage = ((current.meanDuration - baseline.meanDuration) / baseline.meanDuration) * 100; - console.log('Duration increase percentage:', increasePercentage); - if (increasePercentage > durationDeviation) { - console.log(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%. Current percentage: ${increasePercentage}%`); core.setFailed(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%. Current percentage: ${increasePercentage}%`); break; + } else { + console.log(`Duration increase percentage ${increasePercentage}% is within the allowed deviation range of ${durationDeviation}%.`); } } From 809437d1b4263efe0f5d40c760e0a418dafe3c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 6 Jun 2023 11:26:04 +0200 Subject: [PATCH 28/34] fix: build action --- .../validateReassureOutput/index.js | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/actions/javascript/validateReassureOutput/index.js b/.github/actions/javascript/validateReassureOutput/index.js index abb2160e2e0b..6c2eeccc3af8 100644 --- a/.github/actions/javascript/validateReassureOutput/index.js +++ b/.github/actions/javascript/validateReassureOutput/index.js @@ -11,35 +11,26 @@ module.exports = const core = __nccwpck_require__(186); const run = () => { - const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true})); - const countDeviation = core.getInput('COUNT_DEVIATION', {required: true}); - const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', {required: true}); + const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', { required: true })); + const countDeviation = core.getInput('COUNT_DEVIATION', { required: true }); + const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', { required: true }); - console.log('Input values:'); - console.log('REGRESSION_OUTPUT:', regressionOutput); - console.log('COUNT_DEVIATION:', countDeviation); - console.log('DURATION_DEVIATION_PERCENTAGE:', durationDeviation); - - if (regressionOutput.countChanged === undefined) { + if (regressionOutput.countChanged === undefined || regressionOutput.countChanged.length === 0) { console.log('No countChanged data available. Exiting...'); return true; - } + } + + console.log(`Processing ${regressionOutput.countChanged.length} measurements...`); for (let i = 0; i < regressionOutput.countChanged.length; i++) { const measurement = regressionOutput.countChanged[i]; const baseline = measurement.baseline; const current = measurement.current; - console.log(`Processing measurement ${i + 1}:`); - console.log('Measurement:', measurement); - console.log('Baseline:', baseline); - console.log('Current:', current); + console.log(`Processing measurement ${i + 1}: ${measurement.name}`); const renderCountDiff = current.meanCount - baseline.meanCount; - console.log('Render count difference:', renderCountDiff); - if (renderCountDiff >= countDeviation) { - console.log(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); core.setFailed(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); break; } else { @@ -47,10 +38,7 @@ const run = () => { } const increasePercentage = ((current.meanDuration - baseline.meanDuration) / baseline.meanDuration) * 100; - console.log('Duration increase percentage:', increasePercentage); - if (increasePercentage > durationDeviation) { - console.log(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%. Current percentage: ${increasePercentage}%`); core.setFailed(`Duration increase percentage exceeded the allowed deviation of ${durationDeviation}%. Current percentage: ${increasePercentage}%`); break; } else { From 430bef1bbc1aadf1f186b3705f81b78c1293f010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Wed, 7 Jun 2023 11:58:21 +0200 Subject: [PATCH 29/34] fix: count deviation condition, remove pr comment --- .github/actions/javascript/validateReassureOutput/index.js | 2 +- .../validateReassureOutput/validateReassureOutput.js | 2 +- .github/workflows/reassurePerformanceTests.yml | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/actions/javascript/validateReassureOutput/index.js b/.github/actions/javascript/validateReassureOutput/index.js index 6c2eeccc3af8..0d48a2d68981 100644 --- a/.github/actions/javascript/validateReassureOutput/index.js +++ b/.github/actions/javascript/validateReassureOutput/index.js @@ -30,7 +30,7 @@ const run = () => { console.log(`Processing measurement ${i + 1}: ${measurement.name}`); const renderCountDiff = current.meanCount - baseline.meanCount; - if (renderCountDiff >= countDeviation) { + if (renderCountDiff > countDeviation) { core.setFailed(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); break; } else { diff --git a/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js b/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js index 16c09e67a4b4..fce4b2cf931c 100644 --- a/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js +++ b/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js @@ -20,7 +20,7 @@ const run = () => { console.log(`Processing measurement ${i + 1}: ${measurement.name}`); const renderCountDiff = current.meanCount - baseline.meanCount; - if (renderCountDiff >= countDeviation) { + if (renderCountDiff > countDeviation) { core.setFailed(`Render count difference exceeded the allowed deviation of ${countDeviation}. Current difference: ${renderCountDiff}`); break; } else { diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index e850064d459a..fb286b0644be 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -40,11 +40,6 @@ jobs: uses: ArekChr/App/.github/actions/javascript/validateReassureOutput@feat/reassure with: DURATION_DEVIATION_PERCENTAGE: 20 - COUNT_DEVIATION: 1 + COUNT_DEVIATION: 0 REGRESSION_OUTPUT: ${{ steps.reassure.outputs.content }} - - name: Add comment to PR - uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac - with: - github_token: ${{ secrets.OS_BOTIFY_TOKEN }} - body: ${{ steps.reassure.outputs.content }} From 02ff8ee2c43f5e10bbff455a7d37acf713193b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Wed, 7 Jun 2023 12:10:50 +0200 Subject: [PATCH 30/34] fix: remove regression --- tests/perf-test/SidebarLinks.perf-test.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/perf-test/SidebarLinks.perf-test.js b/tests/perf-test/SidebarLinks.perf-test.js index 15e10c6208f9..0928d26dd07e 100644 --- a/tests/perf-test/SidebarLinks.perf-test.js +++ b/tests/perf-test/SidebarLinks.perf-test.js @@ -46,16 +46,6 @@ test('simple Sidebar render with hundred of reports', () => { }); const mockOnyxReports = _.assign({}, ...mockReports); - const TestRegression = () => { - const [render, setRender] = React.useState([]); - - React.useEffect(() => { - setRender((r) => r + 1); - }, []); - - return ; - }; - return waitForPromisesToResolve() .then(() => Onyx.multiSet({ @@ -64,5 +54,5 @@ test('simple Sidebar render with hundred of reports', () => { ...mockOnyxReports, }), ) - .then(() => measurePerformance()); + .then(() => measurePerformance()); }); From 01b0522221e09aa3252590d99ab5ac16e1001b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Wed, 7 Jun 2023 12:18:45 +0200 Subject: [PATCH 31/34] fix: prettier --- .../actions/javascript/validateReassureOutput/index.js | 8 ++++---- .../validateReassureOutput/validateReassureOutput.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/javascript/validateReassureOutput/index.js b/.github/actions/javascript/validateReassureOutput/index.js index 0d48a2d68981..052f4529b0d5 100644 --- a/.github/actions/javascript/validateReassureOutput/index.js +++ b/.github/actions/javascript/validateReassureOutput/index.js @@ -11,14 +11,14 @@ module.exports = const core = __nccwpck_require__(186); const run = () => { - const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', { required: true })); - const countDeviation = core.getInput('COUNT_DEVIATION', { required: true }); - const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', { required: true }); + const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true})); + const countDeviation = core.getInput('COUNT_DEVIATION', {required: true}); + const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', {required: true}); if (regressionOutput.countChanged === undefined || regressionOutput.countChanged.length === 0) { console.log('No countChanged data available. Exiting...'); return true; - } + } console.log(`Processing ${regressionOutput.countChanged.length} measurements...`); diff --git a/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js b/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js index fce4b2cf931c..da81d88c9885 100644 --- a/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js +++ b/.github/actions/javascript/validateReassureOutput/validateReassureOutput.js @@ -1,14 +1,14 @@ const core = require('@actions/core'); const run = () => { - const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', { required: true })); - const countDeviation = core.getInput('COUNT_DEVIATION', { required: true }); - const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', { required: true }); + const regressionOutput = JSON.parse(core.getInput('REGRESSION_OUTPUT', {required: true})); + const countDeviation = core.getInput('COUNT_DEVIATION', {required: true}); + const durationDeviation = core.getInput('DURATION_DEVIATION_PERCENTAGE', {required: true}); if (regressionOutput.countChanged === undefined || regressionOutput.countChanged.length === 0) { console.log('No countChanged data available. Exiting...'); return true; - } + } console.log(`Processing ${regressionOutput.countChanged.length} measurements...`); From 2dc94ab51ffaa9d13cb2a69718378ffa6ff1461c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Wed, 7 Jun 2023 13:11:16 +0200 Subject: [PATCH 32/34] fix: use report validation worflow from upstream --- .github/workflows/reassurePerformanceTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index fb286b0644be..9894efeb9001 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -37,7 +37,7 @@ jobs: - name: Validate output.json id: validateReassureOutput - uses: ArekChr/App/.github/actions/javascript/validateReassureOutput@feat/reassure + uses: Expensify/App/.github/actions/javascript/validateReassureOutput@main with: DURATION_DEVIATION_PERCENTAGE: 20 COUNT_DEVIATION: 0 From 1acf6ad9000bbee9f4f836d5ed07ff7683a3d661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Wed, 7 Jun 2023 17:39:15 +0200 Subject: [PATCH 33/34] fix: remove react import --- tests/perf-test/SidebarLinks.perf-test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/perf-test/SidebarLinks.perf-test.js b/tests/perf-test/SidebarLinks.perf-test.js index 0928d26dd07e..eb2a243d1c06 100644 --- a/tests/perf-test/SidebarLinks.perf-test.js +++ b/tests/perf-test/SidebarLinks.perf-test.js @@ -1,6 +1,5 @@ import {measurePerformance} from 'reassure'; import Onyx from 'react-native-onyx'; -import React from 'react'; import _ from 'underscore'; import * as LHNTestUtils from '../utils/LHNTestUtils'; import CONST from '../../src/CONST'; From e89ac6ed4cbd35c8d699c8b6e1d79b9e60eb9191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Wed, 7 Jun 2023 18:12:22 +0200 Subject: [PATCH 34/34] revert: package lock --- package-lock.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 40ed1ff7b11c..43f750e09267 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2043,9 +2043,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", - "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", + "version": "7.22.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.3.tgz", + "integrity": "sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==", "dependencies": { "regenerator-runtime": "^0.13.11" }, @@ -38905,9 +38905,9 @@ "license": "ISC" }, "node_modules/simple-git": { - "version": "3.18.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.18.0.tgz", - "integrity": "sha512-Yt0GJ5aYrpPci3JyrYcsPz8Xc05Hi4JPSOb+Sgn/BmPX35fn/6Fp9Mef8eMBCrL2siY5w4j49TA5Q+bxPpri1Q==", + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.19.0.tgz", + "integrity": "sha512-hyH2p9Ptxjf/xPuL7HfXbpYt9gKhC1yWDh3KYIAYJJePAKV7AEjLN4xhp7lozOdNiaJ9jlVvAbBymVlcS2jRiA==", "dev": true, "dependencies": { "@kwsites/file-exists": "^1.1.1", @@ -44232,9 +44232,9 @@ } }, "@babel/runtime": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", - "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", + "version": "7.22.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.3.tgz", + "integrity": "sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==", "requires": { "regenerator-runtime": "^0.13.11" } @@ -69202,9 +69202,9 @@ "version": "3.0.7" }, "simple-git": { - "version": "3.18.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.18.0.tgz", - "integrity": "sha512-Yt0GJ5aYrpPci3JyrYcsPz8Xc05Hi4JPSOb+Sgn/BmPX35fn/6Fp9Mef8eMBCrL2siY5w4j49TA5Q+bxPpri1Q==", + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.19.0.tgz", + "integrity": "sha512-hyH2p9Ptxjf/xPuL7HfXbpYt9gKhC1yWDh3KYIAYJJePAKV7AEjLN4xhp7lozOdNiaJ9jlVvAbBymVlcS2jRiA==", "dev": true, "requires": { "@kwsites/file-exists": "^1.1.1",