Commit b34b9bfd authored by Godefroid Chapelle's avatar Godefroid Chapelle

Problem: test suite is slow on Debian and Ubuntu

Solution: fix the testing suite speed hack that depends on
environment variables by avoiding - in env var name.
parent e83b36fd
...@@ -62,7 +62,7 @@ def realpath(path): ...@@ -62,7 +62,7 @@ def realpath(path):
return os.path.normcase(os.path.abspath(_oprp(path))) return os.path.normcase(os.path.abspath(_oprp(path)))
default_index_url = os.environ.get( default_index_url = os.environ.get(
'buildout-testing-index-url', 'buildout_testing_index_url',
'https://pypi.org/simple', 'https://pypi.org/simple',
) )
......
...@@ -265,7 +265,7 @@ def buildoutSetUp(test): ...@@ -265,7 +265,7 @@ def buildoutSetUp(test):
register_teardown(lambda: rmtree(tmp)) register_teardown(lambda: rmtree(tmp))
zc.buildout.easy_install.default_index_url = 'file://'+tmp zc.buildout.easy_install.default_index_url = 'file://'+tmp
os.environ['buildout-testing-index-url'] = ( os.environ['buildout_testing_index_url'] = (
zc.buildout.easy_install.default_index_url) zc.buildout.easy_install.default_index_url)
def tmpdir(name): def tmpdir(name):
......
...@@ -3412,8 +3412,11 @@ extdemo_setup_py = r""" ...@@ -3412,8 +3412,11 @@ extdemo_setup_py = r"""
import os, sys import os, sys
from distutils.core import setup, Extension from distutils.core import setup, Extension
if os.environ.get('test-variable'): if os.environ.get('test_environment_variable'):
print("Have environment test-variable: %%s" %% os.environ['test-variable']) print(
"Have environment test_environment_variable: %%s"
%% os.environ['test_environment_variable']
)
setup(name = "extdemo", version = "%s", url="http://www.zope.org", setup(name = "extdemo", version = "%s", url="http://www.zope.org",
author="Demo", author_email="demo@demo.com", author="Demo", author_email="demo@demo.com",
...@@ -3451,7 +3454,7 @@ def easy_install_SetUp(test): ...@@ -3451,7 +3454,7 @@ def easy_install_SetUp(test):
def buildout_txt_setup(test): def buildout_txt_setup(test):
zc.buildout.testing.buildoutSetUp(test) zc.buildout.testing.buildoutSetUp(test)
mkdir = test.globs['mkdir'] mkdir = test.globs['mkdir']
eggs = os.environ['buildout-testing-index-url'][7:] eggs = os.environ['buildout_testing_index_url'][7:]
test.globs['sample_eggs'] = eggs test.globs['sample_eggs'] = eggs
create_sample_eggs(test) create_sample_eggs(test)
......
...@@ -299,8 +299,8 @@ recipe was run. ...@@ -299,8 +299,8 @@ recipe was run.
... ...
... def install(self): ... def install(self):
... logging.getLogger(self.name).info( ... logging.getLogger(self.name).info(
... 'test-variable left over: %s' % ( ... 'test_environment_variable left over: %s' % (
... 'test-variable' in os.environ)) ... 'test_environment_variable' in os.environ))
... return [] ... return []
... ...
... def update(self): ... def update(self):
...@@ -326,7 +326,7 @@ Create our buildout: ...@@ -326,7 +326,7 @@ Create our buildout:
... parts = extdemo checkenv ... parts = extdemo checkenv
... ...
... [extdemo-env] ... [extdemo-env]
... test-variable = foo ... test_environment_variable = foo
... ...
... [extdemo] ... [extdemo]
... recipe = zc.recipe.egg:custom ... recipe = zc.recipe.egg:custom
...@@ -352,10 +352,10 @@ Create our buildout: ...@@ -352,10 +352,10 @@ Create our buildout:
... ...
Installing checkenv. Installing checkenv.
...Running command python setup.py egg_info ...Running command python setup.py egg_info
...Have environment test-variable: foo ...Have environment test_environment_variable: foo
... ...
The setup.py also printed out that we have set the environment `test-variable` The setup.py also printed out that we have set the environment `test_environment_variable`
to foo. After the buildout the variable is reset to its original value (i.e. to foo. After the buildout the variable is reset to its original value (i.e.
removed). removed).
...@@ -363,14 +363,14 @@ When an environment variable has a value before zc.recipe.egg:custom is run, ...@@ -363,14 +363,14 @@ When an environment variable has a value before zc.recipe.egg:custom is run,
the original value will be restored: the original value will be restored:
>>> import os >>> import os
>>> os.environ['test-variable'] = 'bar' >>> os.environ['test_environment_variable'] = 'bar'
>>> print_(system(buildout), end='') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Updating extdemo. Updating extdemo.
Updating checkenv. Updating checkenv.
checkenv: test-variable left over: True checkenv: test_environment_variable left over: True
>>> os.environ['test-variable'] >>> os.environ['test_environment_variable']
'bar' 'bar'
...@@ -385,7 +385,7 @@ are interpolated with os.environ before the're set: ...@@ -385,7 +385,7 @@ are interpolated with os.environ before the're set:
... parts = extdemo checkenv ... parts = extdemo checkenv
... ...
... [extdemo-env] ... [extdemo-env]
... test-variable = foo:%%(test-variable)s ... test_environment_variable = foo:%%(test_environment_variable)s
... ...
... [extdemo] ... [extdemo]
... recipe = zc.recipe.egg:custom ... recipe = zc.recipe.egg:custom
...@@ -409,12 +409,12 @@ are interpolated with os.environ before the're set: ...@@ -409,12 +409,12 @@ are interpolated with os.environ before the're set:
... ...
Updating checkenv. Updating checkenv.
...Running command python setup.py egg_info ...Running command python setup.py egg_info
...Have environment test-variable: foo:bar ...Have environment test_environment_variable: foo:bar
... ...
>>> os.environ['test-variable'] >>> os.environ['test_environment_variable']
'bar' 'bar'
>>> del os.environ['test-variable'] >>> del os.environ['test_environment_variable']
Create a clean buildout.cfg w/o the checkenv recipe, and delete the recipe: Create a clean buildout.cfg w/o the checkenv recipe, and delete the recipe:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment