You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Andreas Stieger <an...@gmx.de> on 2012/12/12 21:01:11 UTC

[PATCH] Prevent false negative results of "make check" in Python tests

Hello,

discussed on IRC, the patch below changes the test harness to prevent
some false negatives when running the test suite. Specifically, if a
python test initialisation returns in such a way that the test runner
doesn't know how to handle the result, change to code to return a
non-zero exit code like and, subsequently, have "make check" fail
correctly. Reproducible by using Python < 2.5 or missing sqlite3 Python
bindings, exit triggered by
subversion/tests/cmdline/svntest/__init__.py. danielsh,breser hinted +1
for this on IRC.

[[[
Prevent false negative results of "make check" in Python tests

* build/run_tests.py
  (_run_py_test): exit non-zero like _run_c_test
]]]

With kind regards,
Andreas Stieger

Re: [PATCH] Prevent false negative results of "make check" in Python tests

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Andreas Stieger wrote on Wed, Dec 12, 2012 at 20:01:11 +0000:
> Hello,
> 
> discussed on IRC, the patch below changes the test harness to prevent
> some false negatives when running the test suite. Specifically, if a
> python test initialisation returns in such a way that the test runner
> doesn't know how to handle the result, change to code to return a
> non-zero exit code like and, subsequently, have "make check" fail
> correctly. Reproducible by using Python < 2.5 or missing sqlite3 Python
> bindings, exit triggered by
> subversion/tests/cmdline/svntest/__init__.py. danielsh,breser hinted +1
> for this on IRC.

Go ahead and commit.  It's an error path that no one should be running
into; you run into it, and you have 2 +1's, so it's a no brainer. If
anyone have issues I trust they'll do a post-commit review.

> 
> [[[
> Prevent false negative results of "make check" in Python tests
> 
> * build/run_tests.py
>   (_run_py_test): exit non-zero like _run_c_test
> ]]]
> 
> With kind regards,
> Andreas Stieger

> Index: build/run_tests.py
> ===================================================================
> --- build/run_tests.py	(revision 1420930)
> +++ build/run_tests.py	(working copy)
> @@ -434,7 +434,7 @@ class TestHarness:
>                                   ('.py', 'U', imp.PY_SOURCE))
>      except:
>        print("Don't know what to do about " + progbase)
> -      raise
> +      sys.exit(1)
>  
>      import svntest.main
>