Skip to content

Commit

Permalink
benchmark| Add benchmarking option to tox
Browse files Browse the repository at this point in the history
  • Loading branch information
doublethefish committed Apr 21, 2020
1 parent 67d0572 commit cfbb933
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py35, py36, py37, py38, pypy, pylint
envlist = py35, py36, py37, py38, pypy, pylint, benchmark
skip_missing_interpreters = true

[testenv:pylint]
Expand Down Expand Up @@ -53,12 +53,14 @@ deps =
mccabe
pytest
pytest-xdist
pytest-benchmark

setenv =
COVERAGE_FILE = {toxinidir}/.coverage.{envname}

commands =
python -Wignore -m coverage run -m pytest {toxinidir}/tests/ {posargs:}
; Run tests, ensuring all benchmark tests do not run
python -Wignore -m coverage run -m pytest --benchmark-disable {toxinidir}/tests/ {posargs:}

; Transform absolute path to relative path
; for compatibility with coveralls.io and fix 'source not available' error.
Expand Down Expand Up @@ -131,3 +133,29 @@ commands =
rm -f extensions.rst
python ./exts/pylint_extensions.py
sphinx-build -W -b html -d _build/doctrees . _build/html

[testenv:benchmark]
deps =
https://github.com/PyCQA/astroid/tarball/master#egg=astroid-master-2.0
coverage<5.0
isort
mccabe
pytest
pytest-xdist
pygal
pytest-benchmark

commands =
; Run the only the benchmark tests, grouping output and forcing .json output so we
; can compare benchmark runs
python -Wi -m pytest --exitfirst \
--failed-first \
--benchmark-only \
--benchmark-save=batch_files \
--benchmark-save-data \
--benchmark-autosave \
{toxinidir}/tests \
--benchmark-group-by="group" \
{posargs:}

changedir = {toxworkdir}

0 comments on commit cfbb933

Please sign in to comment.