Merge lp:~diegosarmentero/ubuntuone-control-panel/u1-cp-qthread into lp:ubuntuone-control-panel

Proposed by Diego Sarmentero on 2012-10-15
Status: Merged
Approved by: dobey on 2012-10-16
Approved revision: 369
Merged at revision: 369
Proposed branch: lp:~diegosarmentero/ubuntuone-control-panel/u1-cp-qthread
Merge into: lp:ubuntuone-control-panel
Diff against target: 85 lines (+25/-2)
3 files modified
ubuntuone/controlpanel/gui/qt/tests/test_gui.py (+8/-0)
ubuntuone/controlpanel/gui/qt/tests/test_share_links.py (+7/-0)
ubuntuone/controlpanel/gui/qt/tests/test_share_links_search.py (+10/-2)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-control-panel/u1-cp-qthread
Reviewer Review Type Date Requested Status
dobey (community) 2012-10-15 Approve on 2012-10-16
Roberto Alsina (community) Approve on 2012-10-16
Review via email: mp+129722@code.launchpad.net

Commit Message

- Improving tests, patching QThread in the right place (LP: #1066894).

To post a comment you must log in.
dobey (dobey) wrote :

This set of changes is what was causing your previous branch failures on merge. I have no reason to believe landing this separately won't also fail.

The bug report says "race condition" but doesn't document any actual failures or examples of what happens when this race occurs. Can you expand on that race condition in the bug report, and please document the failure case in the bug report?

review: Needs Fixing
dobey (dobey) :
review: Approve
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (273.9 KiB)

The attempt to merge lp:~diegosarmentero/ubuntuone-control-panel/u1-cp-qthread into lp:ubuntuone-control-panel failed. Below is the output from the failed tests.

*** Running DBus test suite ***
ubuntuone.controlpanel.dbustests.test_dbus_service
  BaseTestCase
    runTest ... [OK]
  DBusServiceMainTestCase
    test_dbus_service_cant_register ... Control panel backend already running.
                                   [OK]
    test_dbus_service_main ... [OK]
  DBusServiceTestCase
    test_cant_register_twice ... [SKIPPED]
    test_dbus_busname_created ... [OK]
    test_error_handler_default ... [OK]
    test_error_handler_with_exception ... [OK]
    test_error_handler_with_failure ... [OK]
    test_error_handler_with_non_string_dict ... [OK]
    test_error_handler_with_string_dict ... [OK]
    test_register_service ... [OK]
  FileSyncTestCase
    test_file_sync_status_changed ... [OK]
    test_file_sync_status_disabled ... [OK]
    test_file_sync_status_disconnected ... [OK]
    test_file_sync_status_error ... [OK]
    test_file_sync_status_idle ... [OK]
    test_file_sync_status_starting ... [OK]
    test_file_sync_status_stopped ... [OK]
    test_file_sync_status_syncing ... [OK]
    test_file_sync_status_unknown ... [OK]
    test_status_changed_handler ... [OK]
    test_status_changed_handler_after_status_requested ... [OK]
    test_status_changed_handler_after_status_requested_twice ... [OK]
  OperationsAuthErrorTestCase
    test_account_info_returned ... [OK]
    test_change_device_settings ... [OK]
    test_change_replication_settings ... [OK]
    test_change_volume_settings ... [OK]
    test_connect_files ... [OK]
    test_devices_info_returned ... [OK]
    test_disable_files ... [OK]
    test_disconnect_files ... [OK]
    test_enable_files ... [OK]
    test_remove_device ... [OK]
    test_replications_info ... [OK]
    test_restart_files ... [OK]
   ...

dobey (dobey) wrote :

Setting vote back to needs fixing, as there are additional failures in this now, and the log seems to have sufficient data to help debug this further.

review: Needs Fixing
Roberto Alsina (ralsina) :
review: Approve
dobey (dobey) :
review: Approve
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (223.0 KiB)

The attempt to merge lp:~diegosarmentero/ubuntuone-control-panel/u1-cp-qthread into lp:ubuntuone-control-panel failed. Below is the output from the failed tests.

*** Running DBus test suite ***
ubuntuone.controlpanel.dbustests.test_dbus_service
  BaseTestCase
    runTest ... [OK]
  DBusServiceMainTestCase
    test_dbus_service_cant_register ... Control panel backend already running.
                                   [OK]
    test_dbus_service_main ... [OK]
  DBusServiceTestCase
    test_cant_register_twice ... [SKIPPED]
    test_dbus_busname_created ... [OK]
    test_error_handler_default ... [OK]
    test_error_handler_with_exception ... [OK]
    test_error_handler_with_failure ... [OK]
    test_error_handler_with_non_string_dict ... [OK]
    test_error_handler_with_string_dict ... [OK]
    test_register_service ... [OK]
  FileSyncTestCase
    test_file_sync_status_changed ... [OK]
    test_file_sync_status_disabled ... [OK]
    test_file_sync_status_disconnected ... [OK]
    test_file_sync_status_error ... [OK]
    test_file_sync_status_idle ... [OK]
    test_file_sync_status_starting ... [OK]
    test_file_sync_status_stopped ... [OK]
    test_file_sync_status_syncing ... [OK]
    test_file_sync_status_unknown ... [OK]
    test_status_changed_handler ... [OK]
    test_status_changed_handler_after_status_requested ... [OK]
    test_status_changed_handler_after_status_requested_twice ... [OK]
  OperationsAuthErrorTestCase
    test_account_info_returned ... [OK]
    test_change_device_settings ... [OK]
    test_change_replication_settings ... [OK]
    test_change_volume_settings ... [OK]
    test_connect_files ... [OK]
    test_devices_info_returned ... [OK]
    test_disable_files ... [OK]
    test_disconnect_files ... [OK]
    test_enable_files ... [OK]
    test_remove_device ... [OK]
    test_replications_info ... [OK]
    test_restart_files ... [OK]
   ...

dobey (dobey) wrote :

Still failing with same errors.

review: Needs Fixing
369. By Diego Sarmentero on 2012-10-16

tests fixed

dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_gui.py'
2--- ubuntuone/controlpanel/gui/qt/tests/test_gui.py 2012-08-20 17:51:54 +0000
3+++ ubuntuone/controlpanel/gui/qt/tests/test_gui.py 2012-10-16 14:22:20 +0000
4@@ -19,6 +19,7 @@
5 from twisted.internet import defer
6
7 from ubuntuone.controlpanel.gui.qt import gui
8+from ubuntuone.controlpanel.gui.qt import share_links_search
9 from ubuntuone.controlpanel.gui.qt.tests import BaseTestCase, FakedDialog
10
11
12@@ -40,6 +41,13 @@
13 innerclass_name = "Ui_MainWindow"
14 class_ui = gui.MainWindow
15
16+ @defer.inlineCallbacks
17+ def setUp(self):
18+ """Set the different tests."""
19+ self.patch(share_links_search.SearchBox, "_get_volumes_info",
20+ lambda *args, **kwargs: None)
21+ yield super(MainWindowTestCase, self).setUp()
22+
23 def test_close_event_calls_custom_close_callback(self):
24 """When closing the window, close_callback is called."""
25 self.ui.close_callback = self._set_called
26
27=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_share_links.py'
28--- ubuntuone/controlpanel/gui/qt/tests/test_share_links.py 2012-10-15 14:58:10 +0000
29+++ ubuntuone/controlpanel/gui/qt/tests/test_share_links.py 2012-10-16 14:22:20 +0000
30@@ -19,6 +19,7 @@
31 import os
32
33 from PyQt4 import QtGui, QtCore
34+from twisted.internet import defer
35
36 from ubuntuone.controlpanel.gui import (
37 SEARCH_FILES,
38@@ -41,6 +42,12 @@
39 innerclass_name = "Ui_Form"
40 class_ui = gui.ShareLinksPanel
41
42+ @defer.inlineCallbacks
43+ def setUp(self):
44+ self.patch(gui.share_links_ui.SearchBox, "_get_volumes_info",
45+ lambda *args, **kwargs: None)
46+ yield super(ShareLinksTestCase, self).setUp()
47+
48 def test_setup(self):
49 """Check that the strings are properly setted."""
50 self.assertEqual(self.ui.ui.search_files_lbl.text(), SEARCH_FILES)
51
52=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_share_links_search.py'
53--- ubuntuone/controlpanel/gui/qt/tests/test_share_links_search.py 2012-10-15 14:58:10 +0000
54+++ ubuntuone/controlpanel/gui/qt/tests/test_share_links_search.py 2012-10-16 14:22:20 +0000
55@@ -36,13 +36,17 @@
56
57 @defer.inlineCallbacks
58 def setUp(self):
59+ self.patch(gui.ThreadExploreFolder, "start",
60+ lambda *args, **kwargs: self.fake_start())
61+ self.patch(gui.SearchBox, "_get_volumes_info",
62+ lambda *args, **kwargs: None)
63 yield super(SearchBoxTestCase, self).setUp()
64
65+ self.ui.home_dir = yield self.ui.backend.get_home_dir()
66+ self.ui._thread_explore = gui.ThreadExploreFolder(self.ui.home_dir)
67 self.patch(utils, "user_home", USER_HOME)
68 self.patch(self.ui._thread_explore, "get_folder_info",
69 self.fake_get_folder_info)
70- self.patch(self.ui._thread_explore, "start",
71- lambda *args, **kwargs: self.ui._thread_explore.run())
72 self.folder_info = {
73 'folder1': [
74 os.path.join(USER_HOME, 'ubuntu', 'file1'),
75@@ -57,6 +61,10 @@
76 }
77 self._slot_item = None
78
79+ def fake_start(self):
80+ """Fake thread start."""
81+ self.ui._thread_explore.run()
82+
83 def fake_slot(self, item):
84 """Fake function to be called when itemSelected is emitted."""
85 self._slot_item = item

Subscribers

People subscribed via source and target branches