devops: better upload flakiness dashboard upload script (#6176)

This patch moves some duplicated logic from YAML workflows to
the dashboard uploading script.
This commit is contained in:
Andrey Lushnikov 2021-04-19 10:39:10 -05:00 коммит произвёл GitHub
Родитель 90913160c4
Коммит 2c34eaeaf9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 21 добавлений и 11 удалений

22
.github/workflows/tests.yml поставляемый
Просмотреть файл

@ -41,7 +41,7 @@ jobs:
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run test -- --tag=${{ matrix.browser }}"
- run: node tests/config/checkCoverage.js ${{ matrix.browser }}
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
- uses: actions/upload-artifact@v1
if: always()
with:
@ -66,7 +66,7 @@ jobs:
- run: node lib/cli/cli install-deps ${{ matrix.browser }} chromium
- run: npm run test -- --tag=${{ matrix.browser }}
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
@ -94,7 +94,7 @@ jobs:
- run: npm run test -- --tag=${{ matrix.browser }}
shell: bash
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
shell: bash
- uses: actions/upload-artifact@v1
if: ${{ always() }}
@ -147,7 +147,7 @@ jobs:
env:
HEADFUL: 1
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
@ -179,7 +179,7 @@ jobs:
env:
PWTEST_MODE: "${{ matrix.mode }}"
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
@ -211,7 +211,7 @@ jobs:
env:
PWTEST_VIDEO: 1
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
@ -240,7 +240,7 @@ jobs:
- name: Run tests
run: npm run atest -- --shard=${{ matrix.shard }}/2
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
@ -274,7 +274,7 @@ jobs:
env:
PWTEST_CHANNEL: "chrome"
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
@ -303,7 +303,7 @@ jobs:
env:
PWTEST_CHANNEL: "chrome"
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
shell: bash
- uses: actions/upload-artifact@v1
if: ${{ always() }}
@ -329,7 +329,7 @@ jobs:
env:
PWTEST_CHANNEL: "chrome"
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
@ -383,7 +383,7 @@ jobs:
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npm run etest"
- run: node tests/config/checkCoverage.js electron
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() && github.repository == 'microsoft/playwright' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-'))
if: always()
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:

Просмотреть файл

@ -27,6 +27,16 @@ if [[ ($1 == '--help') || ($1 == '-h') ]]; then
exit 0
fi
if [[ ("${GITHUB_REPOSITORY}" != "microsoft/playwright") && ("${GITHUB_REPOSITORY}" != "microsoft/playwright-internal") ]]; then
echo "NOTE: skipping dashboard uploading from fork"
exit 0
fi
if [[ "${GITHUB_REF}" != "refs/heads/master" && "${GITHUB_REF}" != 'refs/heads/release-'* ]]; then
echo "NOTE: skipping dashboard uploading from Playwright branches"
exit 0
fi
if [[ -z "${FLAKINESS_CONNECTION_STRING}" ]]; then
echo "ERROR: \$FLAKINESS_CONNECTION_STRING environment variable is missing."
echo " 'Azure Account Name' and 'Azure Account Key' secrets are required"