Merge lp:~vila/bzr/688072-skip-sphinx-failures into lp:bzr

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 5568
Proposed branch: lp:~vila/bzr/688072-skip-sphinx-failures
Merge into: lp:bzr
Diff against target: 62 lines (+13/-0)
4 files modified
bzrlib/tests/doc_generate/__init__.py (+5/-0)
bzrlib/tests/doc_generate/builders/test_texinfo.py (+2/-0)
bzrlib/tests/doc_generate/writers/test_texinfo.py (+3/-0)
doc/en/release-notes/bzr-2.3.txt (+3/-0)
To merge this branch: bzr merge lp:~vila/bzr/688072-skip-sphinx-failures
Reviewer Review Type Date Requested Status
bzr-core Pending
Review via email: mp+43227@code.launchpad.net

Commit message

Check sphinx version for tests that need it.

Description of the change

python-sphinx has reached 1.0 (and beyond) but we don't yet have
it widely available in most of our setups.

Lately, some tests have been failing on babune, in fact the last
failures to turn the OSX 10.6 slave blue are due to sphinx-1.0.4.

Since I won't investigate and fix the compatibility with the
various sphinx versions (maverick is at 0.6.6), I'd prefer to
just skip them in the mean time (2 tests only are failing out of 18).

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/9/2010 9:09 AM, Vincent Ladeuil wrote:
> Vincent Ladeuil has proposed merging lp:~vila/bzr/688072-skip-sphinx-failures into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
> Related bugs:
> #688072 tests failures with sphinx >= 1.0
> https://bugs.launchpad.net/bugs/688072
>
>
> python-sphinx has reached 1.0 (and beyond) but we don't yet have
> it widely available in most of our setups.
>
> Lately, some tests have been failing on babune, in fact the last
> failures to turn the OSX 10.6 slave blue are due to sphinx-1.0.4.
>
> Since I won't investigate and fix the compatibility with the
> various sphinx versions (maverick is at 0.6.6), I'd prefer to
> just skip them in the mean time (2 tests only are failing out of 18).
>

+ def sphinx_version(self):
+ # Convert to a tuple to avoid traps in string comparison
+ # ( '1.12' < '1.6' but (1, 12) > (1, 6) )
+ return tuple(features.sphinx.module.__version__.split('.'))
+

^- I'm pretty sure that isn't enough, since '12' < '6'.

You need to map(int(features.sphinx.module.__version__.split('.'))

I'm fine with this, though not supporting maverick is a bit odd.
John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0BMW4ACgkQJdeBCYSNAANP/QCdFomY6sDeVSLevxHMBbLtGf4d
8dQAoMyRoI9H3M5fHG/HIIldztsLpqbV
=Ro+8
-----END PGP SIGNATURE-----

Revision history for this message
Vincent Ladeuil (vila) wrote :

> + return tuple(features.sphinx.module.__version__.split('.'))
> +
>
>
> ^- I'm pretty sure that isn't enough, since '12' < '6'.

Doh ! Thanks, fixed.

> I'm fine with this, though not supporting maverick is a bit odd.

(0, 6, 6) < (1,0) so we support maverick. Keep in mind though, that's the texinfo version needs work for all the intra and extra links anyway.

Revision history for this message
Vincent Ladeuil (vila) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/doc_generate/__init__.py'
2--- bzrlib/tests/doc_generate/__init__.py 2010-07-21 08:07:14 +0000
3+++ bzrlib/tests/doc_generate/__init__.py 2010-12-09 21:38:09 +0000
4@@ -52,6 +52,11 @@
5
6 _test_needs_features = [features.sphinx]
7
8+ def sphinx_version(self):
9+ # Convert to a tuple to avoid traps in string comparison
10+ # ( '1.12' < '1.6' but (1, 12) > (1, 6) )
11+ return tuple(map(int, features.sphinx.module.__version__.split('.')))
12+
13 def make_sphinx(self):
14 out = tests.StringIOWrapper()
15 err = tests.StringIOWrapper()
16
17=== modified file 'bzrlib/tests/doc_generate/builders/test_texinfo.py'
18--- bzrlib/tests/doc_generate/builders/test_texinfo.py 2010-07-06 13:22:32 +0000
19+++ bzrlib/tests/doc_generate/builders/test_texinfo.py 2010-12-09 21:38:09 +0000
20@@ -43,6 +43,8 @@
21 class TestFileProduction(test_dg.TestSphinx):
22
23 def test_files_generated(self):
24+ if self.sphinx_version() >= (1, 0):
25+ raise tests.TestSkipped('Not compatible with sphinx >= 1.0')
26 self.build_tree_contents(
27 [('index.txt', """
28 Table of Contents
29
30=== modified file 'bzrlib/tests/doc_generate/writers/test_texinfo.py'
31--- bzrlib/tests/doc_generate/writers/test_texinfo.py 2010-07-21 08:07:14 +0000
32+++ bzrlib/tests/doc_generate/writers/test_texinfo.py 2010-12-09 21:38:09 +0000
33@@ -16,6 +16,7 @@
34
35 """sphinx texinfo writer tests."""
36
37+from bzrlib import tests
38 from bzrlib.tests import (
39 doc_generate as test_dg, # Avoid clash with from bzrlib import doc_generate
40 )
41@@ -176,6 +177,8 @@
42 class TestTocTreeGeneration(test_dg.TestSphinx):
43
44 def test_toctree(self):
45+ if self.sphinx_version() >= (1, 0):
46+ raise tests.TestSkipped('Not compatible with sphinx >= 1.0')
47 self.build_tree_contents(
48 [('index.txt', """
49 Table of Contents
50
51=== modified file 'doc/en/release-notes/bzr-2.3.txt'
52--- doc/en/release-notes/bzr-2.3.txt 2010-12-07 16:27:49 +0000
53+++ doc/en/release-notes/bzr-2.3.txt 2010-12-09 21:38:09 +0000
54@@ -64,6 +64,9 @@
55 * Catch exceptions related to bug #637821 during test cleanup to avoid
56 spurious failures. (Vincent Ladeuil, #686008).
57
58+* Check sphinx compatibility for tests requiring older sphinx versions.
59+ (Vincent Ladeuil, #688072)
60+
61 * ``TestDebuntuExpansions`` was escaping the test isolation by calling the
62 wrong base class ``setUp``. (Vincent Ladeuil, #684622)
63