Patchwork test: make version based test-extensions failure more explanatory

login
register
mail settings
Submitter Pierre-Yves David
Date March 10, 2015, 6:06 p.m.
Message ID <280d9815eb3c4e3020a8.1426010810@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/7970/
State Accepted
Commit 31e9f66863f31ab3d63241e9d2b9475458151741
Headers show

Comments

Pierre-Yves David - March 10, 2015, 6:06 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1426010470 25200
#      Tue Mar 10 11:01:10 2015 -0700
# Node ID 280d9815eb3c4e3020a8381ec6e88b75ecf2222e
# Parent  a97113b5bce09234a615ef88ef3b2b9aa5f9b5a1
test: make version based test-extensions failure more explanatory

A buggy __version__ content (usually from setup.py's hg being unable to read the
repo) can make this test fails in an obscure manner. We make the root of the
failure more explicit.
Augie Fackler - March 13, 2015, 1:07 a.m.
On Tue, Mar 10, 2015 at 11:06:50AM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1426010470 25200
> #      Tue Mar 10 11:01:10 2015 -0700
> # Node ID 280d9815eb3c4e3020a8381ec6e88b75ecf2222e
> # Parent  a97113b5bce09234a615ef88ef3b2b9aa5f9b5a1
> test: make version based test-extensions failure more explanatory

This was pushed as 31e9f66863f3.

>
> A buggy __version__ content (usually from setup.py's hg being unable to read the
> repo) can make this test fails in an obscure manner. We make the root of the
> failure more explicit.
>
> diff --git a/tests/test-extension.t b/tests/test-extension.t
> --- a/tests/test-extension.t
> +++ b/tests/test-extension.t
> @@ -944,10 +944,13 @@ Older extension is tested with current v
>    ** Extensions loaded: throw, older
>
>  Declare the version as supporting this hg version, show regular bts link:
>    $ hgver=`$PYTHON -c 'from mercurial import util; print util.version().split("+")[0]'`
>    $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
> +  $ if [ -z "$hgver" ]; then
> +  >   echo "unable to fetch a mercurial version. Make sure __version__ is correct";
> +  > fi
>    $ rm -f throw.pyc throw.pyo
>    $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
>    ** unknown exception encountered, please report by visiting
>    ** http://mercurial.selenic.com/wiki/BugTracker
>    ** Python * (glob)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Pierre-Yves David - March 13, 2015, 1:58 a.m.
On 03/12/2015 06:07 PM, Augie Fackler wrote:
> On Tue, Mar 10, 2015 at 11:06:50AM -0700, Pierre-Yves David wrote:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david@fb.com>
>> # Date 1426010470 25200
>> #      Tue Mar 10 11:01:10 2015 -0700
>> # Node ID 280d9815eb3c4e3020a8381ec6e88b75ecf2222e
>> # Parent  a97113b5bce09234a615ef88ef3b2b9aa5f9b5a1
>> test: make version based test-extensions failure more explanatory
>
> This was pushed as 31e9f66863f3.

I think I pushed it by mistake on the clowncopter.

Patch

diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -944,10 +944,13 @@  Older extension is tested with current v
   ** Extensions loaded: throw, older
 
 Declare the version as supporting this hg version, show regular bts link:
   $ hgver=`$PYTHON -c 'from mercurial import util; print util.version().split("+")[0]'`
   $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
+  $ if [ -z "$hgver" ]; then
+  >   echo "unable to fetch a mercurial version. Make sure __version__ is correct";
+  > fi
   $ rm -f throw.pyc throw.pyo
   $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
   ** unknown exception encountered, please report by visiting
   ** http://mercurial.selenic.com/wiki/BugTracker
   ** Python * (glob)