tests: retry some jest tests on failure (#12298)

This commit is contained in:
Connor Clark 2021-04-13 14:38:58 -05:00 коммит произвёл GitHub
Родитель 802947d2d4
Коммит 4a6a1c0995
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 1415 добавлений и 1067 удалений

13
.github/scripts/jest-retry.sh поставляемый Normal file
Просмотреть файл

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Ex: bash jest-retry.sh yarn test-viewer
##
# @license Copyright 2021 The Lighthouse Authors. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
##
set -euxo pipefail
$* || $* --onlyFailures

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

@ -34,13 +34,13 @@ jobs:
# Run tests that require headfull Chrome.
- run: sudo apt-get install xvfb
- name: yarn test-clients
run: xvfb-run --auto-servernum yarn test-clients
run: xvfb-run --auto-servernum bash $GITHUB_WORKSPACE/.github/scripts/jest-retry.sh yarn test-clients
- name: yarn test-docs
run: xvfb-run --auto-servernum yarn test-docs
- name: yarn test-viewer
run: xvfb-run --auto-servernum yarn test-viewer
run: xvfb-run --auto-servernum bash $GITHUB_WORKSPACE/.github/scripts/jest-retry.sh yarn test-viewer
- name: yarn test-treemap
run: xvfb-run --auto-servernum yarn test-treemap
run: xvfb-run --auto-servernum bash $GITHUB_WORKSPACE/.github/scripts/jest-retry.sh yarn test-treemap
- run: yarn diff:sample-json
- run: yarn type-check
@ -127,7 +127,7 @@ jobs:
# For windows, just test the potentially platform-specific code.
- name: yarn unit-cli
run: yarn unit-cli
run: yarn unit-cli || yarn unit-cli --onlyFailures
if: matrix.os == 'windows-latest'
- run: yarn diff:sample-json
if: matrix.os == 'windows-latest'

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

@ -138,7 +138,7 @@
"glob": "^7.1.3",
"idb-keyval": "2.2.0",
"intl-messageformat-parser": "^1.8.1",
"jest": "^24.9.0",
"jest": "^26.6.1",
"jsdom": "^12.2.0",
"lighthouse-plugin-publisher-ads": "^1.3.0",
"lodash.clonedeep": "^4.5.0",

2459
yarn.lock

Разница между файлами не показана из-за своего большого размера Загрузить разницу