Accelerate Tests

- add coverage to the circleci
- combine the divided tests into single folder
- update requirements
This commit is contained in:
Ömer Faruk Özdemir 2022-02-09 08:50:00 +03:00
parent a44e9c3dce
commit 82cb2de626
21 changed files with 20 additions and 4 deletions

View File

@ -40,7 +40,7 @@ jobs:
- run:
command: |
. venv/bin/activate
coverage run -m pytest test
coverage run -m pytest --cov=gradio --durations=20 --durations-min=1 test
coverage xml
- codecov/upload:
file: 'coverage.xml'

View File

@ -1,3 +1,4 @@
# Don't forget to run bash scripts/create_test_requirements.sh from unix or wsl when you update this file.
IPython
comet_ml
coverage
@ -11,3 +12,6 @@ pytest
wandb
huggingface_hub
pytest-cov
black
isort
flake8

View File

@ -21,7 +21,9 @@ attrs==21.4.0
backcall==0.2.0
# via ipython
black==22.1.0
# via ipython
# via
# -r requirements.in
# ipython
cachetools==5.0.0
# via google-auth
certifi==2021.10.8
@ -78,6 +80,8 @@ filelock==3.4.2
# via
# huggingface-hub
# transformers
flake8==4.0.1
# via -r requirements.in
flask==2.0.2
# via
# mlflow
@ -128,6 +132,8 @@ iniconfig==1.1.1
# via pytest
ipython==8.0.1
# via -r requirements.in
isort==5.10.1
# via -r requirements.in
itsdangerous==2.0.1
# via flask
jedi==0.18.1
@ -158,6 +164,8 @@ markupsafe==2.0.1
# mako
matplotlib-inline==0.1.3
# via ipython
mccabe==0.6.1
# via flake8
mlflow==1.23.1
# via -r requirements.in
mypy-extensions==0.4.3
@ -248,8 +256,12 @@ pyasn1==0.4.8
# rsa
pyasn1-modules==0.2.8
# via google-auth
pycodestyle==2.8.0
# via flake8
pycparser==2.21
# via cffi
pyflakes==2.4.0
# via flake8
pygments==2.11.2
# via ipython
pyopenssl==22.0.0

View File

@ -49,11 +49,11 @@ class TestInterface(unittest.TestCase):
Interface(lambda x: x, examples=1234)
def test_examples_valid_path(self):
path = os.path.join(os.path.dirname(__file__), "../test_data/flagged_with_log")
path = os.path.join(os.path.dirname(__file__), "test_data/flagged_with_log")
interface = Interface(lambda x: 3 * x, "number", "number", examples=path)
self.assertEqual(len(interface.get_config_file()["examples"]), 2)
path = os.path.join(os.path.dirname(__file__), "../test_data/flagged_no_log")
path = os.path.join(os.path.dirname(__file__), "test_data/flagged_no_log")
interface = Interface(lambda x: 3 * x, "number", "number", examples=path)
self.assertEqual(len(interface.get_config_file()["examples"]), 3)