From 85231cb7749a3d3436f4a845421623f4cf8b4126 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 17 Feb 2021 04:30:15 -0500 Subject: [PATCH] tests: More descriptive Sauce Labs name --- .github/workflows/frontend-admin-tests.yml | 2 ++ .github/workflows/frontend-tests.yml | 22 ++++++++++++++++++---- src/tests/frontend/travis/remote_runner.js | 6 +++--- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/frontend-admin-tests.yml b/.github/workflows/frontend-admin-tests.yml index 73cf7ab67..8a61b2243 100644 --- a/.github/workflows/frontend-admin-tests.yml +++ b/.github/workflows/frontend-admin-tests.yml @@ -16,6 +16,7 @@ jobs: - name: Generate Sauce Labs strings id: sauce_strings run: | + printf %s\\n '::set-output name=name::${{ github.workflow }} - ${{ github.job }} - Node ${{ matrix.node }}' printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}-node${{ matrix.node }}' - name: Checkout repository @@ -69,6 +70,7 @@ jobs: env: SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} + SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} GIT_HASH: ${{ steps.environment.outputs.sha_short }} run: | diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index 7841f6705..99d7bd0fa 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -8,6 +8,12 @@ jobs: runs-on: ubuntu-latest steps: + - name: Generate Sauce Labs strings + id: sauce_strings + run: | + printf %s\\n '::set-output name=name::${{ github.workflow }} - ${{ github.job }}' + printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}' + - name: Checkout repository uses: actions/checkout@v2 @@ -29,14 +35,15 @@ jobs: with: username: ${{ secrets.SAUCE_USERNAME }} accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} - tunnelIdentifier: ${{ github.run_id }}-${{ github.run_number }}-${{ github.job }} + tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }} - name: Run the frontend tests shell: bash env: SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} - TRAVIS_JOB_NUMBER: ${{ github.run_id }}-${{ github.run_number }}-${{ github.job }} + SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} + TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} GIT_HASH: ${{ steps.environment.outputs.sha_short }} run: | src/tests/frontend/travis/runner.sh @@ -46,6 +53,12 @@ jobs: runs-on: ubuntu-latest steps: + - name: Generate Sauce Labs strings + id: sauce_strings + run: | + printf %s\\n '::set-output name=name::${{ github.workflow }} - ${{ github.job }}' + printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}' + - name: Checkout repository uses: actions/checkout@v2 @@ -100,14 +113,15 @@ jobs: with: username: ${{ secrets.SAUCE_USERNAME }} accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} - tunnelIdentifier: ${{ github.run_id }}-${{ github.run_number }}-${{ github.job }} + tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }} - name: Run the frontend tests shell: bash env: SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} - TRAVIS_JOB_NUMBER: ${{ github.run_id }}-${{ github.run_number }}-${{ github.job }} + SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} + TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} GIT_HASH: ${{ steps.environment.outputs.sha_short }} run: | src/tests/frontend/travis/runner.sh diff --git a/src/tests/frontend/travis/remote_runner.js b/src/tests/frontend/travis/remote_runner.js index 5a75dbe66..0f08a1454 100644 --- a/src/tests/frontend/travis/remote_runner.js +++ b/src/tests/frontend/travis/remote_runner.js @@ -27,9 +27,9 @@ process.on('exit', (code) => { const sauceTestWorker = async.queue((testSettings, callback) => { const browser = wd.promiseChainRemote( config.host, config.port, config.username, config.accessKey); - const name = - `${process.env.GIT_HASH} - ${testSettings.browserName} ` + - `${testSettings.version}, ${testSettings.platform}`; + const name = [process.env.GIT_HASH].concat(process.env.SAUCE_NAME || []).concat([ + `${testSettings.browserName} ${testSettings.version}, ${testSettings.platform}`, + ]).join(' - '); testSettings.name = name; testSettings.public = true; testSettings.build = process.env.GIT_HASH;