Skip to content

parallelize_tests #1951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ python:
- 3.3

install:
- pip install --use-mirrors nose python-dateutil numpy
- pip -q install --use-mirrors nose python-dateutil numpy
# This is a workaround to install the latest versions of pyparsing,
# which are not yet available on PyPI
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "3" ]; then pip install http://sourceforge.net/projects/pyparsing/files/pyparsing/pyparsing-2.0.0/pyparsing-2.0.0.tar.gz; fi'
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip install http://sourceforge.net/projects/pyparsing/files/pyparsing/pyparsing-1.5.7/pyparsing-1.5.7.tar.gz; fi'
- if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then pip install --use-mirrors PIL; fi
- sudo apt-get update && sudo apt-get install inkscape
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "3" ]; then pip -q install http://sourceforge.net/projects/pyparsing/files/pyparsing/pyparsing-2.0.0/pyparsing-2.0.0.tar.gz; fi'
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip -q install http://sourceforge.net/projects/pyparsing/files/pyparsing/pyparsing-1.5.7/pyparsing-1.5.7.tar.gz; fi'
- if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then pip -q install --use-mirrors PIL; fi
- sudo apt-get update && sudo apt-get -qq install inkscape
- python setup.py install

script:
- mkdir ../tmp_test_dir
- cd ../tmp_test_dir
- python ../matplotlib/tests.py -sv
# The number of processes is hardcoded, because using too many causes the
# Travis VM to run out of memory (since so many copies of inkscape and
# ghostscript are running at the same time).
- echo Testing using 8 processes
- python ../matplotlib/tests.py -sv --processes=8 --process-timeout=300
10 changes: 6 additions & 4 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,10 +1167,13 @@ def tk_window_focus():

default_test_modules = [
'matplotlib.tests.test_agg',
'matplotlib.tests.test_arrow_patches',
'matplotlib.tests.test_artist',
'matplotlib.tests.test_axes',
'matplotlib.tests.test_backend_svg',
'matplotlib.tests.test_backend_pdf',
'matplotlib.tests.test_backend_pgf',
'matplotlib.tests.test_backend_qt4',
'matplotlib.tests.test_backend_svg',
'matplotlib.tests.test_basic',
'matplotlib.tests.test_bbox_tight',
'matplotlib.tests.test_cbook',
Expand All @@ -1189,6 +1192,7 @@ def tk_window_focus():
'matplotlib.tests.test_mlab',
'matplotlib.tests.test_patches',
'matplotlib.tests.test_pickle',
'matplotlib.tests.test_png',
'matplotlib.tests.test_rcparams',
'matplotlib.tests.test_scale',
'matplotlib.tests.test_simplification',
Expand All @@ -1198,10 +1202,8 @@ def tk_window_focus():
'matplotlib.tests.test_text',
'matplotlib.tests.test_ticker',
'matplotlib.tests.test_tightlayout',
'matplotlib.tests.test_triangulation',
'matplotlib.tests.test_transforms',
'matplotlib.tests.test_arrow_patches',
'matplotlib.tests.test_backend_qt4',
'matplotlib.tests.test_triangulation',
]


Expand Down
34 changes: 11 additions & 23 deletions lib/matplotlib/testing/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import matplotlib
from matplotlib.compat import subprocess
from matplotlib.testing.noseclasses import ImageComparisonFailure
from matplotlib.testing import image_util, util
from matplotlib.testing import image_util
from matplotlib import _png
from matplotlib import _get_configdir
from distutils import version
Expand Down Expand Up @@ -141,28 +141,16 @@ def convert(old, new):
return convert

if matplotlib.checkdep_ghostscript() is not None:
def make_ghostscript_conversion_command():
# FIXME: make checkdep_ghostscript return the command
if sys.platform == 'win32':
gs = 'gswin32c'
else:
gs = 'gs'
cmd = [gs, '-q', '-sDEVICE=png16m', '-sOutputFile=-']

process = util.MiniExpect(cmd)

def do_convert(old, new):
process.expect("GS>")
process.sendline("(%s) run" % old.replace('\\', '/'))
with open(new, 'wb') as fd:
process.expect(">>showpage, press <return> to continue<<", fd)
process.sendline('')

return do_convert

converter['pdf'] = make_ghostscript_conversion_command()
converter['eps'] = make_ghostscript_conversion_command()

if sys.platform == 'win32':
gs = 'gswin32c'
else:
gs = 'gs'

cmd = lambda old, new: \
[gs, '-q', '-sDEVICE=png16m', '-dNOPAUSE', '-dBATCH',
'-sOutputFile=' + new, old]
converter['pdf'] = make_external_conversion_command(cmd)
converter['eps'] = make_external_conversion_command(cmd)

if matplotlib.checkdep_inkscape() is not None:
cmd = lambda old, new: \
Expand Down
3 changes: 2 additions & 1 deletion lib/matplotlib/testing/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import matplotlib
import matplotlib.tests
import matplotlib.units
from matplotlib import cbook
from matplotlib import ticker
from matplotlib import pyplot as plt
from matplotlib import ft2font
Expand Down Expand Up @@ -281,6 +282,6 @@ def find_dotted_module(module_name, path=None):
result_dir = os.path.abspath(os.path.join('result_images', subdir))

if not os.path.exists(result_dir):
os.makedirs(result_dir)
cbook.mkdirs(result_dir)

return baseline_dir, result_dir
76 changes: 0 additions & 76 deletions lib/matplotlib/testing/util.py

This file was deleted.

Binary file not shown.
Loading