Modify

Opened 9 years ago

Closed 7 years ago

#12056 closed defect (fixed)

XHTML validation errors when running Trac functional test suite

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

I'm seeing some errors for which I haven't yet sorted out the cause, but they seem to be attributable to TagsPlugin. The issue could be that Trac is not handling the TagsPlugin comment markup correctly though.

$ make test=trac/admin/tests/functional.py

Python: /home/user/Workspace/t11944/py2.7/bin/python
                 Version                                            
  ------------------------------------------------------------------
  Python       : 2.7.6 (default, Mar 22 2014, 22:59:56) 
  [GCC 4.8.2]
  Setuptools   : 3.6                                                
  Genshi       : 0.7                                                
  Babel        : 0.9.6                                              
  sqlite3      : 2.6.0                                              
  PySqlite     : not installed                                      
  MySQLdb      : not installed                                      
  Psycopg2     : not installed                                      
  SVN bindings : 1.8.8 (r1568071)                                   
  Mercurial    : not installed                                      
  Pygments     : 1.6                                                
  Pytz         : 2014.4                                             
  ConfigObj    : 5.0.5                                              
  Docutils     : 0.12                                               
  Twill        : 0.9                                                
  LXML         : 3.4.0                                              

  figleaf: /home/user/Workspace/t11944/py2.7/bin/figleaf
  coverage: not installed

Variables:
  PATH=::$PATH
  PYTHONPATH=.::$PYTHONPATH
  TRAC_TEST_DB_URI=
  server-options= -p 8000 -a '*,~/tracenvs/htdigest.realm,realm' -r ~/Workspace/t11944/tracdev

External dependencies:
  Git version: git version 1.9.1
python trac/admin/tests/functional.py 
.............FF.....
======================================================================
FAIL: runTest (__main__.TestPluginSettings)
Check plugin settings.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "trac/admin/tests/functional.py", line 413, in runTest
    self._tester.go_to_admin("Plugins")
  File "/home/user/Workspace/t11944/teo-rjollos.git/trac/tests/functional/tester.py", line 171, in go_to_admin
    tc.follow(r"\b%s\b" % panel_label)
  File "/home/user/Workspace/t11944/py2.7/local/lib/python2.7/site-packages/twill-0.9-py2.7.egg/twill/commands.py", line 199, in follow
    browser.follow_link(link)
  File "/home/user/Workspace/t11944/py2.7/local/lib/python2.7/site-packages/twill-0.9-py2.7.egg/twill/browser.py", line 207, in follow_link
    self._journey('follow_link', link)
  File "/home/user/Workspace/t11944/py2.7/local/lib/python2.7/site-packages/twill-0.9-py2.7.egg/twill/browser.py", line 549, in _journey
    callable(func_name, *args, **kwargs)
  File "/home/user/Workspace/t11944/teo-rjollos.git/trac/tests/functional/better_twill.py", line 126, in _validate_xhtml
    _format_error_log(page, e.error_log))
TwillAssertionError: 
# Element dl is not declared in p list of possible children
# URL: http://127.0.0.1:8629/admin/general/plugin
# Line 3546, column 3

</dd><dt><code>[extra]</code></dt><dd>enable advanced features for specific use cases
</dd></dl>
Make sure to understand their purpose before deactivating <code>[main]</code> or
activating <code>[extra]</code> components.
</p>
</div>
              </td>
              <td class="sel trac-component">
                <input type="hidden" name="component" value="tractags.api.TagSystem" />
                <input type="checkbox" name="enable" value="tractags.api.TagSystem" />
              </td>


======================================================================
FAIL: runTest (__main__.TestPluginsAuthorization)
Check permissions required to access Logging panel.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "trac/admin/tests/functional.py", line 422, in runTest
    "Manage Plugins")
  File "trac/admin/tests/functional.py", line 45, in test_authorization
    tc.go(href)
  File "/home/user/Workspace/t11944/py2.7/local/lib/python2.7/site-packages/twill-0.9-py2.7.egg/twill/commands.py", line 112, in go
    browser.go(url)
  File "/home/user/Workspace/t11944/py2.7/local/lib/python2.7/site-packages/twill-0.9-py2.7.egg/twill/browser.py", line 113, in go
    self._journey('open', u)
  File "/home/user/Workspace/t11944/py2.7/local/lib/python2.7/site-packages/twill-0.9-py2.7.egg/twill/browser.py", line 549, in _journey
    callable(func_name, *args, **kwargs)
  File "/home/user/Workspace/t11944/teo-rjollos.git/trac/tests/functional/better_twill.py", line 126, in _validate_xhtml
    _format_error_log(page, e.error_log))
TwillAssertionError: 
# Element dl is not declared in p list of possible children
# URL: http://127.0.0.1:8629/admin/general/plugin
# Line 3546, column 3

</dd><dt><code>[extra]</code></dt><dd>enable advanced features for specific use cases
</dd></dl>
Make sure to understand their purpose before deactivating <code>[main]</code> or
activating <code>[extra]</code> components.
</p>
</div>
              </td>
              <td class="sel trac-component">
                <input type="hidden" name="component" value="tractags.api.TagSystem" />
                <input type="checkbox" name="enable" value="tractags.api.TagSystem" />
              </td>


----------------------------------------------------------------------
Ran 20 tests in 105.501s

FAILED (failures=2)
make: *** [all] Error 1

Attachments (0)

Change History (8)

comment:1 Changed 9 years ago by Ryan J Ollos

Cc: anonymous removed

comment:2 Changed 8 years ago by Ryan J Ollos

Owner: Steffen Hoffmann deleted

comment:3 Changed 8 years ago by Ryan J Ollos

Output from a full test run with Trac 1.2dev:

python  trac/tests/functional/__init__.py 
......................................................................................................................F............................................................................................FF......
======================================================================
FAIL: runTest (trac.ticket.tests.functional.main.TestTicketQueryLinksQueryModuleDisabled)
Ticket query links should not be present when the QueryModule
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/ticket/tests/functional/main.py", line 428, in runTest
    enable_query_module(True)
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/ticket/tests/functional/main.py", line 386, in enable_query_module
    self._tester.go_to_admin('Plugins')
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/tests/functional/tester.py", line 178, in go_to_admin
    tc.follow(r"\b%s\b" % panel_label)
  File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/twill/commands.py", line 199, in follow
    browser.follow_link(link)
  File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/twill/browser.py", line 207, in follow_link
    self._journey('follow_link', link)
  File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/twill/browser.py", line 549, in _journey
    callable(func_name, *args, **kwargs)
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/tests/functional/better_twill.py", line 128, in _validate_xhtml
    _format_error_log(page, e.error_log))
TwillAssertionError: 
# Element dl is not declared in p list of possible children
# URL: http://127.0.0.1:8561/admin/general/plugin
# Line 4074, column 5

</dd><dt><code>[extra]</code></dt><dd>enable advanced features for specific use cases
</dd></dl>
Make sure to understand their purpose before deactivating <code>[main]</code> or
activating <code>[extra]</code> components.
</p>
</div>
              </td>
              <td class="sel trac-component">
                <input type="hidden" name="component" value="tractags.api.TagSystem" />
                <input type="checkbox" name="enable" value="tractags.api.TagSystem" />
              </td>


======================================================================
FAIL: runTest (trac.admin.tests.functional.TestPluginSettings)
Check plugin settings.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/admin/tests/functional.py", line 424, in runTest
    self._tester.go_to_admin("Plugins")
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/tests/functional/tester.py", line 178, in go_to_admin
    tc.follow(r"\b%s\b" % panel_label)
  File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/twill/commands.py", line 199, in follow
    browser.follow_link(link)
  File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/twill/browser.py", line 207, in follow_link
    self._journey('follow_link', link)
  File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/twill/browser.py", line 549, in _journey
    callable(func_name, *args, **kwargs)
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/tests/functional/better_twill.py", line 128, in _validate_xhtml
    _format_error_log(page, e.error_log))
TwillAssertionError: 
# Element dl is not declared in p list of possible children
# URL: http://127.0.0.1:8561/admin/general/plugin
# Line 4117, column 5

</dd><dt><code>[extra]</code></dt><dd>enable advanced features for specific use cases
</dd></dl>
Make sure to understand their purpose before deactivating <code>[main]</code> or
activating <code>[extra]</code> components.
</p>
</div>
              </td>
              <td class="sel trac-component">
                <input type="hidden" name="component" value="tractags.api.TagSystem" />
                <input type="checkbox" name="enable" value="tractags.api.TagSystem" />
              </td>


======================================================================
FAIL: runTest (trac.admin.tests.functional.TestPluginsAuthorization)
Check permissions required to access Logging panel.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/admin/tests/functional.py", line 433, in runTest
    "Manage Plugins")
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/admin/tests/functional.py", line 45, in test_authorization
    tc.go(href)
  File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/twill/commands.py", line 112, in go
    browser.go(url)
  File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/twill/browser.py", line 113, in go
    self._journey('open', u)
  File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/twill/browser.py", line 549, in _journey
    callable(func_name, *args, **kwargs)
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/tests/functional/better_twill.py", line 128, in _validate_xhtml
    _format_error_log(page, e.error_log))
TwillAssertionError: 
# Element dl is not declared in p list of possible children
# URL: http://127.0.0.1:8561/admin/general/plugin
# Line 4117, column 5

</dd><dt><code>[extra]</code></dt><dd>enable advanced features for specific use cases
</dd></dl>
Make sure to understand their purpose before deactivating <code>[main]</code> or
activating <code>[extra]</code> components.
</p>
</div>
              </td>
              <td class="sel trac-component">
                <input type="hidden" name="component" value="tractags.api.TagSystem" />
                <input type="checkbox" name="enable" value="tractags.api.TagSystem" />
              </td>


----------------------------------------------------------------------
Ran 219 tests in 420.514s

FAILED (failures=3)
make: *** [functional-test] Error 1

comment:4 Changed 7 years ago by Ryan J Ollos

r16053 and r16054 reminded me - if there are no other issues found, we could bump trunk from 0.9dev to 0.9 after resolving this ticket.

comment:5 Changed 7 years ago by Ryan J Ollos

This seems to be associated with changes in r13865. It looks like a description list is being generated due to use of definition lists in formatting. The component description is wrapped in p tags, and the error says that nesting a dl within a p is not allowed.

Immediate fix is to just fix the formatting of the component description. We might also want to make a change to Trac to use a div rather than p for the component description.

Last edited 7 years ago by Ryan J Ollos (previous) (diff)

comment:6 Changed 7 years ago by Ryan J Ollos

The HTML generated by Firefox and Chrome appears to be fine, no p elements nested with the dl.

<p>
Available components are marked according to their relevance as follows:
</p><dl class="wiki"><dt><tt>[main]</tt></dt><dd>provide core with a generic tagging engine as well as support
for common realms 'ticket' (<a class="wiki" href="/proj-1.0/wiki/TracTickets">TracTickets</a>) and 'wiki' (<a class="wiki" href="/proj-1.0/wiki/TracWiki">TracWiki</a>).
</dd><dt><tt>[opt]</tt></dt><dd>add more features to improve user experience and maintenance
</dd><dt><tt>[extra]</tt></dt><dd>enable advanced features for specific use cases
</dd></dl>
Make sure to understand their purpose before deactivating <tt>[main]</tt> or
activating <tt>[extra]</tt> components.
<p></p>

I increased the number of lines printed for the case of an XMLSyntaxError:

<p>
Available components are marked according to their relevance as follows:
<dl class="wiki"><dt><code>[main]</code></dt><dd>provide core with a generic tagging engine as well as support
for common realms 'ticket' (<a class="wiki" href="/wiki/TracTickets">TracTickets</a>) and 'wiki' (<a class="wiki" href="/wiki/TracWiki">TracWiki</a>).
</dd><dt><code>[opt]</code></dt><dd>add more features to improve user experience and maintenance
</dd><dt><code>[extra]</code></dt><dd>enable advanced features for specific use cases
</dd></dl>
Make sure to understand their purpose before deactivating <code>[main]</code> or
activating <code>[extra]</code> components.
</p>

It's clear the dl is wrapped in p.

More details reported in trac:#12638.

comment:7 Changed 7 years ago by Ryan J Ollos

Owner: set to Ryan J Ollos
Status: newaccepted

comment:8 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 16093:

0.9dev: Workaround invalid HTML generation by adding newlines

Fixes #12056.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.