On Fri, Sep 20, 2013 at 12:16 AM, Anze Staric <anze.staric@gmail.com> wrote:
> The failing tests assume that code
> # Create some dummy objects
> self.insert_ticket('ticket 1')
> self.insert_wiki('page 1', 'content')
> with self.product('p1'):
> self.insert_ticket('ticket 2')
> self.insert_wiki('page 1', 'content')
>
> creates a ticket with id1 in default product and ticket with id 2 in
> product p1. That changed when bep-0010 was merged, both ticket now get
> id 1, so the expected counts of matching tickets are wrong.
>
> When I check all the test cases to ensure that this is really the
> problem behind all the failures, I will commit the correct counts,
> unless someone know a better approach to fix the tests.
>
>
> Anze
Thanks Anze. It would have taken me quite a bit longer to track that down
myself! Since you've been so helpful, let me raise another issue ;)
When I execute just the tests in search_resources, they all pass:
PYTHONPATH=. python -m bhsearch.tests.search_resources.__init__
....s...s....................................
----------------------------------------------------------------------
Ran 45 tests in 0.706s
OK (skipped=2)
However, when I executed all of the tests, I get the errors shown below.
The problem seems to be somewhere in security.suite(). If I comment out the
adding of that suite, the tests pass. If security.suite() is after
search_resources.suite(), the tests also pass. However, currently
security.suite() is executed before all of the tests in the search_resouces
module, and wouldn't want to hide a potential problem by just reordering
the execution to get the tests to pass.
PYTHONPATH=. python -m bhsearch.tests.__init__
...............s...s......................................................................................................................s...s.............EEE.........E..........
======================================================================
ERROR: test_that_tickets_updated_after_milestone_delete_no_retarget
(bhsearch.tests.search_resources.milestone_search.MilestoneIndexerEventsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "bhsearch/tests/search_resources/milestone_search.py", line 150, in
test_that_tickets_updated_after_milestone_delete_no_retarget
milestone.delete()
File
"/home/user/Workspace/bh598/bloodhound-trunk.svn/trac/trac/ticket/model.py",
line 1048, in delete
(self.name,))]
TypeError: int() argument must be a string or a number, not 'NoneType'
======================================================================
ERROR: test_that_tickets_updated_after_milestone_delete_with_retarget
(bhsearch.tests.search_resources.milestone_search.MilestoneIndexerEventsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "bhsearch/tests/search_resources/milestone_search.py", line 167, in
test_that_tickets_updated_after_milestone_delete_with_retarget
milestone.delete(retarget_to=RETARGET_MILESTONE)
File
"/home/user/Workspace/bh598/bloodhound-trunk.svn/trac/trac/ticket/model.py",
line 1048, in delete
(self.name,))]
TypeError: int() argument must be a string or a number, not 'NoneType'
======================================================================
ERROR: test_that_tickets_updated_after_milestone_renaming
(bhsearch.tests.search_resources.milestone_search.MilestoneIndexerEventsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "bhsearch/tests/search_resources/milestone_search.py", line 135, in
test_that_tickets_updated_after_milestone_renaming
milestone.update()
File
"/home/user/Workspace/bh598/bloodhound-trunk.svn/trac/trac/ticket/model.py",
line 1123, in update
ResourceSystem(self.env).resource_changed(self, old_values)
File
"/home/user/Workspace/bh598/bloodhound-trunk.svn/trac/trac/resource.py",
line 558, in resource_changed
listener.resource_changed(resource, old_values, context)
File "bhsearch/search_resources/milestone_search.py", line 62, in
resource_changed
self._rename_milestone(resource, old_values["name"])
File "bhsearch/search_resources/milestone_search.py", line 86, in
_rename_milestone
search_api, operation_context, milestone=milestone.name)
File "bhsearch/search_resources/ticket_search.py", line 128, in
reindex_tickets
for ticket in self._fetch_tickets(**kwargs):
File "bhsearch/search_resources/ticket_search.py", line 132, in
_fetch_tickets
for ticket_id in self._fetch_ids(**kwargs):
File "bhsearch/search_resources/ticket_search.py", line 145, in _fetch_ids
yield int(row[0])
TypeError: int() argument must be a string or a number, not 'NoneType'
======================================================================
ERROR: test_that_tickets_updated_after_component_renaming
(bhsearch.tests.search_resources.ticket_search.TicketIndexerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "bhsearch/tests/search_resources/ticket_search.py", line 71, in
test_that_tickets_updated_after_component_renaming
component.update()
File
"/home/user/Workspace/bh598/bloodhound-trunk.svn/trac/trac/ticket/model.py",
line 922, in update
ResourceSystem(self.env).resource_changed(self, old_values)
File
"/home/user/Workspace/bh598/bloodhound-trunk.svn/trac/trac/resource.py",
line 558, in resource_changed
listener.resource_changed(resource, old_values, context)
File "bhsearch/search_resources/ticket_search.py", line 82, in
resource_changed
self._component_changed(resource, old_values)
File "bhsearch/search_resources/ticket_search.py", line 101, in
_component_changed
component=component.name)
File "bhsearch/search_resources/ticket_search.py", line 128, in
reindex_tickets
for ticket in self._fetch_tickets(**kwargs):
File "bhsearch/search_resources/ticket_search.py", line 132, in
_fetch_tickets
for ticket_id in self._fetch_ids(**kwargs):
File "bhsearch/search_resources/ticket_search.py", line 145, in _fetch_ids
yield int(row[0])
TypeError: int() argument must be a string or a number, not 'NoneType'
----------------------------------------------------------------------
Ran 179 tests in 6.739s
FAILED (errors=4, skipped=4)
|