test: Update flaky test #2677
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "**" | |
env: | |
JEST_ENV: prod | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
git fetch --depth=1 origin +${{github.base_ref}} | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Node cache | |
uses: actions/cache@v1 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Run pre-commit checks | |
uses: pre-commit/action@v3.0.0 | |
- name: Install client dependencies | |
run: | | |
cd client | |
npm install | |
- name: Lint src with eslint | |
working-directory: ./client | |
run: | | |
npm run lint | |
- name: Install dev dependencies | |
run: | | |
cd server | |
pip install -r requirements-dev.txt | |
# We can't have mypy in the pre-commit hook without having it run on all files | |
# in the repo, because (probably) the --all-files argument in pre-commit overrides | |
# the more narrow specifying of files in pyproject.toml | |
# TODO: Remove this if/when all files are mypy-compliant | |
- name: Run mypy | |
run: | | |
mypy --config-file pyproject.toml | |
unit-test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Python cache | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "client/.nvmrc" | |
cache: "npm" | |
cache-dependency-path: "client/package-lock.json" | |
- name: Install dependencies | |
run: make dev-env-server build-for-server-dev | |
- name: Unit tests | |
run: | | |
make unit-test-server | |
bash <(curl -s https://codecov.io/bash) -y .codecov.yml -k server -cF server,python,unitTest | |
cd client && ./node_modules/codecov/bin/codecov --yml=../.codecov.yml --root=../ --gcov-root=../ -C -F frontend,javascript,unitTest | |
smoke-tests: | |
runs-on: ubuntu-22.04 | |
# (thuang): We now run the smoke tests against 2 datasets sequentially, so need longer timeout | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Chromatic needs full Git history graph | |
fetch-depth: 0 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Python cache | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "client/.nvmrc" | |
cache: "npm" | |
cache-dependency-path: "client/package-lock.json" | |
- name: Install dependencies | |
run: | | |
make dev-env-server build-for-server-dev | |
cd client | |
npx playwright install | |
- name: Smoke tests (without annotations feature) | |
run: | | |
cd client && make smoke-test | |
./node_modules/codecov/bin/codecov --yml=../.codecov.yml --root=../ --gcov-root=../ -C -F frontend,javascript,smokeTest | |
- name: Publish to Chromatic | |
uses: chromaui/action@latest | |
with: | |
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
workingDir: ./client | |
# This is `npm run build-archive-storybook` | |
buildScriptName: "build-archive-storybook" | |
exitOnceUploaded: true | |
- name: Upload FE test results as an artifact | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: playwright-report | |
path: ~/**/playwright-report/* | |
retention-days: 14 | |
- name: Upload blob report to GitHub Actions Artifacts | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: all-blob-reports | |
path: ~/**/blob-report/* | |
retention-days: 1 |