[Checkins] [zopefoundation/zope.testrunner] 6f4268: Do not be silent if a layer goes missing

GitHub noreply at github.com
Wed May 29 15:16:24 UTC 2013


  Branch: refs/heads/fix-issue-6
  Home:   https://github.com/zopefoundation/zope.testrunner
  Commit: 6f42681154fb97e2586223c8a5dd37e58a69a8c6
      https://github.com/zopefoundation/zope.testrunner/commit/6f42681154fb97e2586223c8a5dd37e58a69a8c6
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2013-05-29 (Wed, 29 May 2013)

  Changed paths:
    M src/zope/testrunner/filter.py

  Log Message:
  -----------
  Do not be silent if a layer goes missing

When we run some test layers in a subprocess (e.g. when you use
zope-testrunner -j2), each subprocess crawls the --test-path to find the
tests again.

If the --test-path is a relative pathname, and the parent process
changes the working directory during the test run, this will cause the
child process to fail to find the tests.  That is an error, and it
shouldn't be silently ignored.

This change needs automated tests!  I only tested it manually (and my
working directory has other uncommitted changes).


  Commit: d26f86fb0ea5baae08f43f6196790982595822a9
      https://github.com/zopefoundation/zope.testrunner/commit/d26f86fb0ea5baae08f43f6196790982595822a9
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2013-05-29 (Wed, 29 May 2013)

  Changed paths:
    M src/zope/testrunner/__init__.py
    M src/zope/testrunner/runner.py

  Log Message:
  -----------
  Fix subprocess execution when tests change the working directory

Fixes issue #6.

Note that most people use zope.testrunner via zc.buildout and
zc.recipe.testrunner.  That recipe changes the wrapper script to do two
things:

  sys.argv[0] = os.path.abspath(sys.argv[0])
  os.chdir('/top/of/the/source/tree')

which are exactly what is needed to make test runner subprocesses work
correctly.

Now the standalone zope-testrunner script (what you get when you pip
install zope.testrunner) will do that by itself, and people who use tox
or travis-ci will not be sad.

Note: this change needs unit tests -- I only tested it manually.


Compare: https://github.com/zopefoundation/zope.testrunner/compare/6f42681154fb^...d26f86fb0ea5


More information about the checkins mailing list