2021-10-13 23:06:40 -05:00
|
|
|
version: 2.1
|
2021-10-13 23:05:40 -05:00
|
|
|
orbs:
|
2022-04-18 11:22:45 -07:00
|
|
|
codecov: codecov/codecov@3.2.2
|
2022-04-27 02:05:50 +01:00
|
|
|
node: circleci/node@5.0.2
|
2022-07-11 13:20:11 -04:00
|
|
|
|
2019-05-30 01:03:00 -07:00
|
|
|
jobs:
|
2022-07-11 13:20:11 -04:00
|
|
|
test:
|
|
|
|
parameters:
|
|
|
|
test-type:
|
|
|
|
type: string
|
2022-07-19 10:48:46 -04:00
|
|
|
python-version:
|
|
|
|
type: string
|
2022-04-27 02:05:50 +01:00
|
|
|
environment:
|
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
2019-05-30 01:03:00 -07:00
|
|
|
docker:
|
2022-07-19 10:48:46 -04:00
|
|
|
- image: cimg/python:<< parameters.python-version >>-browsers
|
2019-05-30 01:03:00 -07:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: mkdir test-reports
|
2021-08-17 18:42:30 +00:00
|
|
|
- restore_cache:
|
2022-07-19 10:48:46 -04:00
|
|
|
key: deps4-{{ .Branch }}-{{ checksum "requirements.txt" }}-<< parameters.python-version >>
|
2022-04-05 23:48:32 +03:00
|
|
|
- run:
|
|
|
|
name: Install ffmpeg
|
|
|
|
command: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install ffmpeg -y
|
2019-05-30 00:53:37 -07:00
|
|
|
- run:
|
2019-05-30 01:03:00 -07:00
|
|
|
name: Install Python deps in a venv
|
2019-05-30 00:53:37 -07:00
|
|
|
command: |
|
2022-07-19 10:48:46 -04:00
|
|
|
python -m venv venv
|
2019-05-30 01:03:00 -07:00
|
|
|
. venv/bin/activate
|
2022-07-04 09:57:12 -04:00
|
|
|
bash scripts/install_gradio.sh
|
2022-02-04 15:23:11 +03:00
|
|
|
bash scripts/install_test_requirements.sh
|
2021-08-17 18:42:30 +00:00
|
|
|
- save_cache:
|
2022-07-19 10:48:46 -04:00
|
|
|
key: deps4-{{ .Branch }}-{{ checksum "requirements.txt" }}-<< parameters.python-version >>
|
2021-08-17 18:42:30 +00:00
|
|
|
paths:
|
|
|
|
- "venv"
|
2021-10-26 16:58:47 +00:00
|
|
|
- node/install:
|
2022-04-27 02:05:50 +01:00
|
|
|
node-version: "16"
|
2021-10-25 20:41:03 +00:00
|
|
|
- run:
|
|
|
|
name: Build frontend
|
|
|
|
command: |
|
2022-05-02 12:27:26 +01:00
|
|
|
npm i pnpm@6 -g
|
2022-02-10 19:22:22 +00:00
|
|
|
cd ui
|
|
|
|
pnpm i --frozen-lockfile
|
|
|
|
pnpm build
|
2020-10-23 18:28:30 +04:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
mkdir screenshots
|
2022-02-09 11:08:01 +03:00
|
|
|
- run:
|
|
|
|
command: |
|
2022-02-09 13:37:25 +03:00
|
|
|
. venv/bin/activate
|
2022-02-09 11:08:01 +03:00
|
|
|
python -m black --check gradio test
|
2022-02-09 14:55:18 +03:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
. venv/bin/activate
|
2022-02-09 17:32:43 +03:00
|
|
|
python -m isort --profile=black --check-only gradio test
|
2022-02-09 14:55:18 +03:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
. venv/bin/activate
|
2022-05-13 09:30:11 +03:00
|
|
|
python -m flake8 --ignore=E731,E501,E722,W503,E126,F401,E203,F403 gradio test
|
2022-03-29 19:18:27 +03:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
. venv/bin/activate
|
2022-07-11 13:20:11 -04:00
|
|
|
coverage run -m pytest -m "<< parameters.test-type >>"
|
2022-03-29 19:18:27 +03:00
|
|
|
coverage xml
|
2021-10-13 23:05:40 -05:00
|
|
|
- codecov/upload:
|
2022-04-27 02:05:50 +01:00
|
|
|
file: "coverage.xml"
|
2019-05-30 01:03:00 -07:00
|
|
|
- store_artifacts:
|
2020-10-23 18:28:30 +04:00
|
|
|
path: /home/circleci/project/test/tmp
|
|
|
|
destination: screenshots
|
2019-05-30 01:03:00 -07:00
|
|
|
- store_test_results:
|
2021-02-17 09:50:11 -08:00
|
|
|
path: test-reports/
|
2022-07-11 13:20:11 -04:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
backend:
|
|
|
|
jobs:
|
|
|
|
- test:
|
|
|
|
matrix:
|
|
|
|
parameters:
|
|
|
|
test-type: ["not flaky", "flaky"]
|
2022-07-19 10:48:46 -04:00
|
|
|
python-version: ["3.9.2", "3.7.13"]
|