From 9429fb8fad312c1347341618c6805b1c82e48afe Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 26 Jul 2017 10:25:38 -0400 Subject: [PATCH] Allow some control over trial command run by tox The TAHOE_LAFS_TRIAL_ARGS environment variable can now be used to pass arguments to tox. If it is unset, some sensible defaults will be used. --- README.rst | 5 +++++ tox.ini | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index db1f167be..55dcc912b 100644 --- a/README.rst +++ b/README.rst @@ -46,6 +46,11 @@ To run the unit test suite: * ``tox`` +You can pass arguments to ``trial`` with an environment variable. For +example, you can run the test suite on multiple cores to speed it up: + +* ``TAHOE_LAFS_TRIAL_ARGS="-j4" tox`` + For more detailed instructions, read ``_ . Once ``tahoe --version`` works, see ``_ to learn how to set diff --git a/tox.ini b/tox.ini index 1654c51d1..2c1735092 100644 --- a/tox.ini +++ b/tox.ini @@ -8,14 +8,14 @@ envlist = py27 minversion = 1.7 [testenv] -passenv = USERPROFILE HOMEDRIVE HOMEPATH +passenv = TAHOE_LAFS_TRIAL_ARGS USERPROFILE HOMEDRIVE HOMEPATH # the default install is non-(--editable), and would displace our -e .[test] skip_install = True deps = --editable=.[test] commands = pyflakes src static misc setup.py tahoe --version - trial --rterrors {posargs:allmydata} + trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors} {posargs:allmydata} [testenv:integration] commands = @@ -24,13 +24,13 @@ commands = [testenv:coverage] # coverage (with --branch) takes about 65% longer to run -passenv = USERPROFILE HOMEDRIVE HOMEPATH +passenv = TAHOE_LAFS_TRIAL_ARGS USERPROFILE HOMEDRIVE HOMEPATH skip_install = True deps = --editable=.[test] commands = pyflakes src static misc setup.py tahoe --version - coverage run --branch -m allmydata.test.run_trial --rterrors --reporter=timing {posargs:allmydata} + coverage run --branch -m allmydata.test.run_trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors --reporter=timing} {posargs:allmydata} coverage xml [testenv:codechecks] @@ -49,17 +49,17 @@ commands = [testenv:deprecations] basepython=python2.7 -passenv = USERPROFILE HOMEDRIVE HOMEPATH +passenv = TAHOE_LAFS_TRIAL_ARGS USERPROFILE HOMEDRIVE HOMEPATH skip_install = True deps = --editable=.[test] setenv = PYTHONWARNINGS=default::DeprecationWarning commands = - python misc/build_helpers/run-deprecations.py --warnings=_trial_temp/deprecation-warnings.log trial --rterrors {posargs:allmydata} + python misc/build_helpers/run-deprecations.py --warnings=_trial_temp/deprecation-warnings.log trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors} {posargs:allmydata} [testenv:upcoming-deprecations] basepython=python2.7 -passenv = USERPROFILE HOMEDRIVE HOMEPATH +passenv = TAHOE_LAFS_TRIAL_ARGS USERPROFILE HOMEDRIVE HOMEPATH setenv = PYTHONWARNINGS=default::DeprecationWarning skip_install = True @@ -69,7 +69,7 @@ deps = git+https://github.com/warner/foolscap commands = flogtool --version - python misc/build_helpers/run-deprecations.py --warnings=_trial_temp/deprecation-warnings.log trial --rterrors {posargs:allmydata} + python misc/build_helpers/run-deprecations.py --warnings=_trial_temp/deprecation-warnings.log trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors} {posargs:allmydata} [testenv:checkmemory] commands =