New issue 263: A real-world problems with Tox 2+ environment variable isolation
https://bitbucket.org/hpk42/tox/issue/263/a-real-world-problems-with-tox-2

saaj:

Another v2 problem that took me several hours of wondering *why*.

Briefly, it was a CI service *drone.io* and a code coverage service 
*codecov.io*. Here's the relevant snippet from its client that can explain the 
problem without me talking much about it:

```
#!python

elif os.getenv('CI') == "true" and os.getenv('DRONE') == "true":
    # http://docs.drone.io/env.html
    defaults.update(dict(branch=os.getenv('DRONE_BRANCH'),
                         service='drone.io',
                         build=os.getenv('DRONE_BUILD_NUMBER'),
                         build_url=os.getenv('DRONE_BUILD_URL'),
                         commit=os.getenv('DRONE_COMMIT')))
```
And an QA env that may look something like this obviously no longer sends 
coverage data because it can't get information about the environment.

```
#!ini

[testenv:qa]
deps = coverage
commands = 
  coverage run --branch --source=lib setup.py test
  codecov
```

I bet most of much QA services and their clients work the same way to identify 
service, commit, branches, etc. And it's quite reasonable to do such things 
from within a Tox env or even have dedicated Tox envs. So there's a serious 
doubt that this idea of environment isolation (which already leaks because of 
LANG exception) turned on by default is compatible with real-world Tox usage. 
At very least there should be an option to restore outer environment at once.

Of course one can look at the env spec of a CI service, then examine QA 
service's client and put bunch of  `passenv` in `tox.ini`. But have doubts than 
many developer will be happy about it. 

As a side note, because it's already third v2 problem (others were missing LANG 
with broken py3, missing {envsitepackagesdir}) I tend to think current v2 
series is not production ready and is beta at most. Reverted to v1 again.




_______________________________________________
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit

Reply via email to