Modify

Opened 15 months ago

Last modified 14 months ago

#13066 new defect

Test failures

Reported by: Ryan J Ollos Owned by:
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Olemis Lang, osimons Trac Release:

Description

Running tests on 1.0-stable with OSX results in one failure:

======================================================================
FAIL: test_xml_encoding_special_characters (tracrpc.tests.xml_rpc.RpcXmlTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/trac-dev/xmlrpcplugin/tracrpc/tests/xml_rpc.py", line 113, in test_xml_encoding_special_characters
    ticket[3]['description'])
AssertionError: 'Desc & ription\r\nLine 2' != 'Desc & ription\nLine 2'

----------------------------------------------------------------------

With Trac 1.2-stable, two additional failures:

======================================================================
FAIL: test_xml_encoding_special_characters (tracrpc.tests.xml_rpc.RpcXmlTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/trac-dev/xmlrpcplugin/tracrpc/tests/xml_rpc.py", line 113, in test_xml_encoding_special_characters
    ticket[3]['description'])
AssertionError: 'Desc & ription\r\nLine 2' != 'Desc & ription\nLine 2'

======================================================================
FAIL: test_getActions (tracrpc.tests.ticket.RpcTicketTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/trac-dev/xmlrpcplugin/tracrpc/tests/ticket.py", line 73, in test_getActions
    self.assertEquals(actions, default)
AssertionError: Lists differ: [['leave', 'leave', 'The owner... != [['leave', 'leave', 'The ticke...

First differing element 0:
['leave', 'leave', 'The owner will remain <span class="trac-author">&lt; default &gt;</span>.', []]
['leave', 'leave', 'The ticket will remain with no owner.', []]

Diff is 1304 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_update_action (tracrpc.tests.ticket.RpcTicketTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/trac-dev/xmlrpcplugin/tracrpc/tests/ticket.py", line 335, in test_update_action
    self.assertEqual('', current[3].get('owner', ''))
AssertionError: '' != '< default >'

----------------------------------------------------------------------

The two failures on 1.2-stable look like changes I'm familiar with from Trac 1.2, so not unexpected.

Attachments (1)

t13066.diff (2.3 KB) - added by Ryan J Ollos 14 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 14 months ago by Ryan J Ollos

Owner: changed from osimons to Ryan J Ollos
Status: newaccepted

Changed 14 months ago by Ryan J Ollos

Attachment: t13066.diff added

comment:2 Changed 14 months ago by Ryan J Ollos

Cc: osimons added

Any idea about this failure? I see it on OSX with Trac 1.0 as well.

======================================================================
FAIL: test_xml_encoding_special_characters (tracrpc.tests.xml_rpc.RpcXmlTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/trac-dev/trac-hacks/xmlrpcplugin/trunk/tracrpc/tests/xml_rpc.py", line 113, in test_xml_encoding_special_characters
    ticket[3]['description'])
AssertionError: 'Desc & ription\r\nLine 2' != 'Desc & ription\nLine 2'

----------------------------------------------------------------------
Ran 58 tests in 66.747s

FAILED (failures=1)
Test failed: <unittest.runner.TextTestResult run=58 errors=0 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=58 errors=0 failures=1>

Other proposed changes in attachment:t13066.diff. Tests pass for me with Trac 1.0 and 1.2-stable.

comment:3 Changed 14 months ago by osimons

For \r\n vs \n background see #2482. I noticed it recently but have not researched the cause.

As for proposed changes in attachment I can't remember the details of styling anymore, but as this is just changes to tests I trust that my 0.12.x testing won't break later ;-)

comment:4 Changed 14 months ago by Ryan J Ollos

The response sent in xmlrpcplugin/trunk/tracrpc/xml_rpc.py@13776:177#L169 contains the \r\n. I ran tests r13776 and 1.0-stable and the failure is seen. Any ideas where to look next?

comment:5 Changed 14 months ago by Ryan J Ollos

Probably unrelated to the comment:2 issue, but on 1.2-stable the following is output at the end of the test run:

Test failed: <unittest.runner.TextTestResult run=58 errors=0 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=58 errors=0 failures=1>
/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/__init__.py:413: RuntimeWarning: Parent module 'trac.util' not found while handling absolute import
  import signal

The RuntimeWarning isn't seen if I move import signal to module scope: trac:browser:branches/1.2-stable/trac/util/__init__.py@15609:413#L392.

comment:6 Changed 14 months ago by Ryan J Ollos

In 16279:

XmlRpcPlugin 1.1.6: Fix test failures with Trac 1.2-stable

Refs #13066.

comment:7 Changed 14 months ago by Ryan J Ollos

Owner: Ryan J Ollos deleted
Status: acceptednew

Remaining issue to be fixed is test failure shown in comment:1.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


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

 
Note: See TracTickets for help on using tickets.