[TIP] RFC: tox-2.0.dev version with ENV isolation / platform restriction support

holger krekel holger at merlinux.eu
Tue Apr 21 04:42:30 PDT 2015


Hi again,

so i went ahead and implemented the new PASSENV option and while
i was at it, also a new PLATFORM setting.  If some of you could
try out the new version via:

    pip install https://devpi.net/hpk/dev/+f/437/cfbc67e733353/tox-2.0.0.dev1.tar.gz
    
i'd appreciate feedback.  See preliminary short reference docs:

https://testrun.org/tox/dev/config.html#confval-passenv=SPACE-SEPARATED-GLOBNAMES

http://testrun.org/tox/dev/config.html#confval-platform=REGEX

along with some short examples:

https://testrun.org/tox/dev/example/basic.html#specifying-a-platform
https://testrun.org/tox/dev/example/basic.html#passing-down-environment-variables

In my own projects i uncovered already one hidden ENV dependency :)

holger




On Sun, Apr 19, 2015 at 07:31 +0000, holger krekel wrote:
> Hi tox users,
> 
> for tox-2.0 i'd like to introduce environment variable isolation.  The
> idea is that only a minimal default set of environment variables is
> transferred to the test environment in contrast to the tox<2.0 where
> all environment variables are copied to the test run.  With tox-2.0 one
> can thus make sure tests don't depend on random env variables but only
> those which are specified with tox.ini.
> 
> If you want to transfer any other variables you'd have to use a new "passenv"
> setting.  For example to pass through the content of LANG (used for locale settings)
> and typical home-directory settings (on win32 and unix):
> 
>     [testenv]
>     passenv = LANG HOME HOMEDIR HOMEDRIVE
> 
> If an env variable does not exist it is ignored, remains unset in the test run.
> This allows to uncover hidden envvar dependencies and explicitely control them.
> FYI you can today already use the "setenv" option to specify env vars::
> 
>     [testenv]
>     setenv =
>         MYENV = somesetting
> 
> But there is no way to prevent/exclude env variables to be copied to the test run
> from the environment variable set with which you invoke tox.
> 
> For a somewhat smoother transition it might make sense to default to the
> old behaviour (transfer all env variables) with tox-2.0.X and assume passenv
> transfers all variables via a default "*" setting but issue a warning
> and with tox-2.1 then default to an empty passenv setting.
> 
> comments welcome,
> holger
> 
> -- 
> about me:    http://holgerkrekel.net/about-me/
> contracting: http://merlinux.eu
> 
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
> 

-- 
about me:    http://holgerkrekel.net/about-me/
contracting: http://merlinux.eu



More information about the testing-in-python mailing list