test feedback

use global PYTEST_ARGS for nicer, simpler always-on arguments for pytest
This commit is contained in:
Min RK
2021-10-28 23:22:54 +02:00
parent 468aa5e93c
commit 65ce06b116
2 changed files with 14 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ on:
env:
# UTF-8 content may be interpreted as ascii and causes errors without this.
LANG: C.UTF-8
PYTEST_ADDOPTS: "--verbose --color=yes"
jobs:
rest-api:
@@ -28,8 +29,10 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: "3.9"
# in addition to the doc requirements
# the docs *tests* require pre-commit and pytest
- run: |
pip install -r docs/requirements.txt pytest -e .
pip install -r docs/requirements.txt pytest pre-commit -e .
- run: |
pytest docs/
@@ -199,10 +202,8 @@ jobs:
fi
- name: Run pytest
# FIXME: --color=yes explicitly set because:
# https://github.com/actions/runner/issues/241
run: |
pytest -v --maxfail=2 --color=yes --cov=jupyterhub jupyterhub/tests
pytest --maxfail=2 --cov=jupyterhub jupyterhub/tests
- name: Run yarn jest test
run: |
cd jsx && yarn && yarn test

View File

@@ -12,7 +12,7 @@ root = here.parent
def test_rest_api_version():
version_py = root.joinpath("jupyterhub", "_version.py")
rest_api_yaml = root.joinpath("docs", "rest-api.yml")
rest_api_yaml = root.joinpath("docs", "source", "_static", "rest-api.yml")
ns = {}
with version_py.open() as f:
exec(f.read(), {}, ns)
@@ -28,12 +28,18 @@ def test_rest_api_version():
def test_restapi_scopes():
run([sys.executable, "source/rbac/generate-scope-table.py"], cwd=here, check=True)
run(
['pre-commit', 'run', 'prettier', '--files', 'rest-api.yml'],
['pre-commit', 'run', 'prettier', '--files', 'source/_static/rest-api.yml'],
cwd=here,
check=False,
)
run(
["git", "diff", "--exit-code", str(here.joinpath("rest-api.yml"))],
[
"git",
"diff",
"--no-pager",
"--exit-code",
str(here.joinpath("source", "_static", "rest-api.yml")),
],
cwd=here,
check=True,
)