From 07fb795fa1f66cdb0f108137b3bc16c35cfa1edd Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Thu, 21 May 2020 11:41:13 -0500 Subject: [PATCH] Add test-timing comparison for UI PRs (#7929) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This runs ember-test-audit for UI PRs to compare how long the tests take for the base vs the PR. It posts or updates a comparison of times and test count. It’s somewhat slow to report back as it runs the test suite three times to even out variability in a shared environment. If we end up being unhappy with that slowness, we could try running the repetitions in parallel as well, but that would involve more changes to ember-test-audit. --- .github/workflows/ember-test-audit.yml | 71 ++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/ember-test-audit.yml diff --git a/.github/workflows/ember-test-audit.yml b/.github/workflows/ember-test-audit.yml new file mode 100644 index 000000000..e951a00ff --- /dev/null +++ b/.github/workflows/ember-test-audit.yml @@ -0,0 +1,71 @@ +name: Ember test audit comparison +on: + pull_request: + paths: + - 'ui/**' + +defaults: + run: + working-directory: ui + +# There’s currently no way to share steps between jobs so there’s a lot of duplication +# for running the audit for the base and PR. + +jobs: + time-base: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.base.sha }} + - uses: nanasess/setup-chromedriver@master + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '10.x' + - run: yarn --frozen-lockfile + - run: mkdir -p /tmp/test-reports + - run: npx ember-test-audit 3 --json --output ../base-audit.json + - name: Upload result + uses: actions/upload-artifact@v2 + with: + name: base-audit + path: base-audit.json + time-pr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: nanasess/setup-chromedriver@master + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '10.x' + - run: yarn --frozen-lockfile + - run: mkdir -p /tmp/test-reports + - run: npx ember-test-audit 3 --json --output ../pr-audit.json + - name: Upload result + uses: actions/upload-artifact@v2 + with: + name: pr-audit + path: pr-audit.json + compare: + needs: [time-base, time-pr] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v2 + with: + name: base-audit + - uses: actions/download-artifact@v2 + with: + name: pr-audit + - uses: backspace/ember-test-audit-comparison-action@v1.0 + with: + base-report-path: base-audit.json + comparison-report-path: pr-audit.json + base-identifier: ${{ github.event.pull_request.base.ref }} + comparison-identifier: ${{ github.event.pull_request.head.sha }} + output-path: audit-diff.md + - uses: marocchino/sticky-pull-request-comment@33a6cfb + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + path: audit-diff.md