From 7000176572e048ca542cf9cb56d2a26ddc76ca70 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Mon, 14 Jun 2021 14:53:22 +0100 Subject: [PATCH 1/8] Add workflow steps to track measurements --- .github/workflows/develop.yml | 21 +++++++++++++++++---- test/end-to-end-tests/start.js | 8 ++++++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 3f82e61280..749999cfc3 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -20,8 +20,21 @@ jobs: test/end-to-end-tests/logs/**/* test/end-to-end-tests/synapse/installations/consent/homeserver.log retention-days: 14 - - name: Archive performance benchmark - uses: actions/upload-artifact@v2 + - name: Download previous benchmark data + uses: actions/cache@v1 with: - name: performance-entries.json - path: test/end-to-end-tests/performance-entries.json + path: ./cache + key: ${{ runner.os }}-benchmark + - name: Temporary step before having a fully release GitHub action + run: npm install && npm run build + working-directory: /home/runner/work/_actions/matrix-org/github-action-benchmark/9f891b47906b73678ba486f7a53e4807e24fff19 + - name: Store benchmark result + uses: matrix-org/github-action-benchmark@9f891b47906b73678ba486f7a53e4807e24fff19 + with: + tool: 'jsperformanceentry' + output-file-path: test/end-to-end-tests/performance-entries.json + external-data-json-path: ./cache/benchmark-data-template.json + fail-on-alert: false + - name: Push benchmark result + if: ${{ github.ref == 'refs/heads/develop' }} + run: git push 'https://matrixbot:${{ secrets.DEPLOY_GH_PAGES }}@github.com/matrix-org/matrix-react-sdk.git' gh-pages:gh-pages diff --git a/test/end-to-end-tests/start.js b/test/end-to-end-tests/start.js index f29b485c84..c1588e848e 100644 --- a/test/end-to-end-tests/start.js +++ b/test/end-to-end-tests/start.js @@ -79,7 +79,7 @@ async function runTests() { await new Promise((resolve) => setTimeout(resolve, 5 * 60 * 1000)); } - const performanceEntries = {}; + let performanceEntries; await Promise.all(sessions.map(async (session) => { // Collecting all performance monitoring data before closing the session @@ -95,7 +95,11 @@ async function runTests() { }, true); return measurements; }); - performanceEntries[session.username] = JSON.parse(measurements); + + /** + * TODO: temporary only use one user session data + */ + performanceEntries = JSON.parse(measurements); return session.close(); })); fs.writeFileSync(`performance-entries.json`, JSON.stringify(performanceEntries)); From 6e3ece2dc615a005bf5e06bbd5735a5f98e55bc6 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Mon, 14 Jun 2021 15:29:18 +0100 Subject: [PATCH 2/8] use proper released github action --- .github/workflows/develop.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 749999cfc3..fe744a5aa8 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -25,11 +25,8 @@ jobs: with: path: ./cache key: ${{ runner.os }}-benchmark - - name: Temporary step before having a fully release GitHub action - run: npm install && npm run build - working-directory: /home/runner/work/_actions/matrix-org/github-action-benchmark/9f891b47906b73678ba486f7a53e4807e24fff19 - name: Store benchmark result - uses: matrix-org/github-action-benchmark@9f891b47906b73678ba486f7a53e4807e24fff19 + uses: matrix-org/github-action-benchmark@jsperfentry with: tool: 'jsperformanceentry' output-file-path: test/end-to-end-tests/performance-entries.json From 646416c8ec6b984e3971ed9d1ecd215b7d40eeb4 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Tue, 15 Jun 2021 08:59:51 +0100 Subject: [PATCH 3/8] try deployment to gh-pages --- .github/workflows/develop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index fe744a5aa8..fe4061d268 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -33,5 +33,5 @@ jobs: external-data-json-path: ./cache/benchmark-data-template.json fail-on-alert: false - name: Push benchmark result - if: ${{ github.ref == 'refs/heads/develop' }} - run: git push 'https://matrixbot:${{ secrets.DEPLOY_GH_PAGES }}@github.com/matrix-org/matrix-react-sdk.git' gh-pages:gh-pages + # if: ${{ github.ref == 'refs/heads/develop' }} + run: git push 'https://RiotRobot:${{ secrets.DEPLOY_GH_PAGES }}@github.com/matrix-org/matrix-react-sdk.git' gh-pages:gh-pages From 6f6a128587e26d1e7e0c3826651db25db5f0e9a0 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Tue, 15 Jun 2021 09:27:44 +0100 Subject: [PATCH 4/8] try auto push --- .github/workflows/develop.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index fe4061d268..83dc884af4 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -30,8 +30,8 @@ jobs: with: tool: 'jsperformanceentry' output-file-path: test/end-to-end-tests/performance-entries.json - external-data-json-path: ./cache/benchmark-data-template.json fail-on-alert: false - - name: Push benchmark result - # if: ${{ github.ref == 'refs/heads/develop' }} - run: git push 'https://RiotRobot:${{ secrets.DEPLOY_GH_PAGES }}@github.com/matrix-org/matrix-react-sdk.git' gh-pages:gh-pages + # Personal access token to deploy GitHub Pages branch + github-token: ${{ secrets.DEPLOY_GH_PAGES }} + # Push and deploy GitHub pages branch automatically + auto-push: true From 55a9915c55e5579e9a90c4c164c38df591a290a8 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Tue, 15 Jun 2021 10:01:05 +0100 Subject: [PATCH 5/8] Upgrade github-action-benchmark --- .github/workflows/develop.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 83dc884af4..0e382aae8b 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -26,12 +26,13 @@ jobs: path: ./cache key: ${{ runner.os }}-benchmark - name: Store benchmark result - uses: matrix-org/github-action-benchmark@jsperfentry + uses: matrix-org/github-action-benchmark@jsperfentry-1 with: tool: 'jsperformanceentry' output-file-path: test/end-to-end-tests/performance-entries.json fail-on-alert: false # Personal access token to deploy GitHub Pages branch - github-token: ${{ secrets.DEPLOY_GH_PAGES }} + github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} # Push and deploy GitHub pages branch automatically auto-push: true + # auto-push: ${{ github.ref == 'refs/heads/develop' }} From 2b2e83b9e755f98de9287ed6d19c2bff098f09b9 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Tue, 15 Jun 2021 10:10:22 +0100 Subject: [PATCH 6/8] Fix github token --- .github/workflows/develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 0e382aae8b..00752a8693 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -32,7 +32,7 @@ jobs: output-file-path: test/end-to-end-tests/performance-entries.json fail-on-alert: false # Personal access token to deploy GitHub Pages branch - github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} + github-token: ${{ secrets.DEPLOY_GH_PAGES }} # Push and deploy GitHub pages branch automatically auto-push: true # auto-push: ${{ github.ref == 'refs/heads/develop' }} From d5f7f524e13b580dc5ed0384f4b1930f9a65ea60 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Tue, 15 Jun 2021 10:24:07 +0100 Subject: [PATCH 7/8] Slow down registration process --- src/components/structures/MatrixChat.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 16da9321e2..c2ec313907 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1953,6 +1953,12 @@ export default class MatrixChat extends React.PureComponent { // Create and start the client await Lifecycle.setLoggedIn(credentials); await this.postLoginSetup(); + + // artifically slowing down the registration + await (new Promise((resolve) => { + setTimeout(resolve, 1337); + })); + PerformanceMonitor.instance.stop(PerformanceEntryNames.LOGIN); PerformanceMonitor.instance.stop(PerformanceEntryNames.REGISTER); }; From 011a2f2bb6075767b20506874ff7797fddf81175 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Tue, 15 Jun 2021 10:59:57 +0100 Subject: [PATCH 8/8] Remove test data for develop pipeline --- .github/workflows/develop.yml | 8 ++++---- src/components/structures/MatrixChat.tsx | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 00752a8693..273dea1062 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -31,8 +31,8 @@ jobs: tool: 'jsperformanceentry' output-file-path: test/end-to-end-tests/performance-entries.json fail-on-alert: false - # Personal access token to deploy GitHub Pages branch + comment-on-alert: true + # Only temporary to monitor where failures occur + alert-comment-cc-users: '@gsouquet' github-token: ${{ secrets.DEPLOY_GH_PAGES }} - # Push and deploy GitHub pages branch automatically - auto-push: true - # auto-push: ${{ github.ref == 'refs/heads/develop' }} + auto-push: ${{ github.ref == 'refs/heads/develop' }} diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index c2ec313907..0af2d3d635 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1954,11 +1954,6 @@ export default class MatrixChat extends React.PureComponent { await Lifecycle.setLoggedIn(credentials); await this.postLoginSetup(); - // artifically slowing down the registration - await (new Promise((resolve) => { - setTimeout(resolve, 1337); - })); - PerformanceMonitor.instance.stop(PerformanceEntryNames.LOGIN); PerformanceMonitor.instance.stop(PerformanceEntryNames.REGISTER); };