plone / diazo

Diazo applies a static HTML theme to a dynamic website
http://diazo.org
Other
41 stars 26 forks source link

Tests of branch 1.1.x fail on coredev 4.3 #51

Closed mauritsvanrees closed 9 years ago

mauritsvanrees commented 9 years ago

Plone coredev pins diazo to 1.0.6, but in the sources.cfg it is using branch 1.1.x. When you checkout this branch, buildout fails:

Installing test.
The constraint, 1.0.8, is not consistent with the requirement, 'WebOb>=1.4'.
While:
  Installing test.
Error: Bad constraint 1.0.8 WebOb>=1.4

Okay, so a few version pins are needed:

future = 0.13.1 (was unspecified)
importlib = 1.0.3 (was unspecified)
repoze.xmliter = 0.6 (was 0.5)
WebOb = 1.4.1 (was 1.0.8)

With those pins, buildout succeeds. But a few diazo tests fail:

$ bin/test -s diazo
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
  Running:
    27/190 (14.2%)--- /Users/maurits/community/plone-coredev/4.3/src/diazo/lib/diazo/tests/entities/output.html 

+++ now 

@@ -1,14 +1,9 @@

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
-  <body>
-    <p>The theme is parsed as HTML so entities like   and — are understood.</p>
-    <p>The content is parsed as HTML so entities like   and — are understood.</p>
-    <p>The rules are parsed as XML, this means that:</p>
-    <ul>
+    <body><p>The theme is parsed as HTML so entities like   and — are understood.</p><p>The content is parsed as HTML so entities like   and — are understood.</p><p>The rules are parsed as XML, this means that:</p><ul>
             <li>The predefined XML entities are always available: ", &amp;, ', &lt;, &gt;.</li>
-            <li>Other entities must be explicitly declared in the doctype, as they are here for   and —.</li>
+            <li>Other entities must be explicitly declared in the doctype, as they are here for   and —.</li>
             <li><a href="http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references">More on character entity references</a></li>
-        </ul>
-  </body>
+        </ul></body>
 </html>

Failure in test testAll (diazo.tests.test_diazo.Test-entities)
Traceback (most recent call last):
  File "/usr/local/pythons/parts/opt/lib/python2.6/unittest.py", line 279, in run
    testMethod()
  File "/Users/maurits/community/plone-coredev/4.3/src/diazo/lib/diazo/tests/test_diazo.py", line 181, in testAll
    assert old == new, "output.html has CHANGED"
AssertionError: output.html has CHANGED

    149/190 (78.4%)--- /Users/maurits/community/plone-coredev/4.3/src/diazo/docs/recipes/create-list-from-anchors/output.html 

+++ now 

@@ -1,14 +1,13 @@

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
-  <body>
-    <div id="content">
+  <body><div id="content">
     <div class="pagination-centered"><ul class="pagination">
         <li><span class="next">
             <a href="?b_start:int=20">
                 Next
                 20
                 items
-            »
+            »
             </a>
         </span></li>
         [<li><span>1</span></li>]
@@ -23,7 +22,6 @@

             <a href="?b_start:int=680">35</a>
         </span></li>
     </ul></div>
-</div>
-  </body>
+</div></body>
 </html>

Failure in test testAll (diazo.tests.test_diazo.Recipe-create-list-from-anchors)
Traceback (most recent call last):
  File "/usr/local/pythons/parts/opt/lib/python2.6/unittest.py", line 279, in run
    testMethod()
  File "/Users/maurits/community/plone-coredev/4.3/src/diazo/lib/diazo/tests/test_diazo.py", line 181, in testAll
    assert old == new, "output.html has CHANGED"
AssertionError: output.html has CHANGED

  Ran 190 tests with 2 failures, 0 errors, 0 skipped in 1.598 seconds.
Tearing down left over layers:
  Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.

Reverting to 1.1.1 makes the tests pass again, so this is something introduced in 1.1.2.

For now, I will create a 1.0.x branch for good measure. Well... let me make a pull request with 1.1.x checked out first, so Jenkins can have a go at it, just in case the test failures are only on my laptop.

( I am checking if coredev with checkout of all packages works.)

mauritsvanrees commented 9 years ago

I fixed this with commit b2d90031059eefdce96ddab4b8b6efe866a9ee5d.

@lrowe With this commit I reverted your commit 218b41f0cae91a3dd0d7ee8c1b460150c68e2801. All tox tests pass now. Any objections? Note this is on the 1.1.x branch which is used by Plone 4.3 coredev, which should work on Python 2.6.

lrowe commented 9 years ago

@mauritsvanrees have you tried breaking a test to see how the error reporting code responds?

mauritsvanrees commented 9 years ago

Let's see. I'll introduce two extra characters in tests/absolute-prefix/output.html. Then I test it with tox -e py34.

With your commit included, I get this:

testAll (diazo.tests.test_diazo.Test-absolute-prefix) ... --- /Users/maurits/community/plone-coredev/4.3/src/diazo/lib/diazo/tests/absolute-prefix/output.html

+++ now

@@ -2,7 +2,7 @@

 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-    <title>Absolutely prefix</title>
+    <title>Absolute prefix</title>
     <style type="text/css">
       @import "/abs/foo.css";
       @import url("/abs/foo.css");
@@ -22,19 +22,6 @@

     <script type="text/javascript" src="/foo.js"></script>
     <script type="text/javascript" src="http://site.com/foo.js"></script>
   </head>
-  <body>
-    <img src="/abs/foo.jpg" />
-    <img src="/abs/foo.jpg" />
-    <img src="/foo.jpg" />
-    <img src="/foo.jpg" />
-    <img src="http://site.com/foo.jpg" />
-    <input type="submit" src="/abs/foo.jpg" />
-    <input type="submit" src="/abs/foo.jpg" />
-    <input type="submit" src="/foo.jpg" />
-    <input type="submit" src="/foo.jpg" />
-    <input type="submit" src="http://site.com/foo.jpg" />
-    <a href="/abs/foo.html">Link</a>
-    <a href="#foo">Anchor</a>
-  </body>
+  <body><img src="/abs/foo.jpg" /><img src="/abs/foo.jpg" /><img src="/foo.jpg" /><img src="/foo.jpg" /><img src="http://site.com/foo.jpg" /><input type="submit" src="/abs/foo.jpg" /><input type="submit" src="/abs/foo.jpg" /><input type="submit" src="/foo.jpg" /><input type="submit" src="/foo.jpg" /><input type="submit" src="http://site.com/foo.jpg" /><a href="/abs/foo.html">Link</a><a href="#foo">Anchor</a></body>
 </html>

FAIL
...
======================================================================
FAIL: testAll (diazo.tests.test_diazo.Test-absolute-prefix)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/maurits/community/plone-coredev/4.3/src/diazo/lib/diazo/tests/test_diazo.py", line 181, in testAll
    assert old == new, "output.html has CHANGED"
AssertionError: output.html has CHANGED

----------------------------------------------------------------------
Ran 190 tests in 1.698s

FAILED (failures=1)

With your commit reverted, it is exactly the same (except a few thousands of a second in the time taken for the tests).

So seems fine to me.

mauritsvanrees commented 9 years ago

I have released 1.1.3 with this (for use on Plone 4.3). And 1.2.2 (for use on Plone 5).