From 7000176572e048ca542cf9cb56d2a26ddc76ca70 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Mon, 14 Jun 2021 14:53:22 +0100 Subject: [PATCH] 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));