Merge lp:~ev/apport/whoopsie into lp:apport

Proposed by Evan on 2012-03-07
Status: Merged
Merged at revision: 2226
Proposed branch: lp:~ev/apport/whoopsie
Merge into: lp:apport
Diff against target: 173 lines (+38/-4) (has conflicts)
5 files modified
gtk/apport-gtk (+2/-0)
kde/apport-kde (+4/-4)
test/test_ui.py (+11/-0)
test/test_ui_gtk.py (+11/-0)
test/test_ui_kde.py (+10/-0)
Text conflict in test/test_ui.py
To merge this branch: bzr merge lp:~ev/apport/whoopsie
Reviewer Review Type Date Requested Status
Martin Pitt 2012-03-07 Approve on 2012-03-08
Review via email: mp+96416@code.launchpad.net
To post a comment you must log in.
Martin Pitt (pitti) wrote :

Thanks!

review: Approve
Martin Pitt (pitti) wrote :

Just to be save, I'll add a "if 'DistroRelease' in self.report:'.

Martin Pitt (pitti) wrote :

I get three test case failures:

======================================================================
FAIL: test_package_crash_layout (__main__.T)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_ui_gtk.py", line 119, in test_package_crash_layout
    self.distro.split()[0])
AssertionError: 'Crash report' != u'Ubuntu'

======================================================================
FAIL: test_regular_crash_layout (__main__.T)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_ui_gtk.py", line 156, in test_regular_crash_layout
    self.distro.split()[0])
AssertionError: 'Crash report' != u'Ubuntu'

======================================================================
FAIL: test_system_crash_from_console_layout (__main__.T)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_ui_gtk.py", line 224, in test_system_crash_from_console_layout
    self.distro.split()[0])
AssertionError: 'Crash report' != u'Ubuntu'

review: Needs Fixing
lp:~ev/apport/whoopsie updated on 2012-03-08
2225. By Martin Pitt on 2012-03-08

ui.py: Ensure that the report file is readable by the crash reporting daemon after running through collect_info(). Thanks Evan Dandrea.

Evan (ev) wrote :

Fixed in r2227.

Martin Pitt (pitti) wrote :

Thanks! Looks fine now.

review: Approve
lp:~ev/apport/whoopsie updated on 2012-03-08
2226. By Martin Pitt on 2012-03-08

apport-gtk, apport-kde: Set the window title to the distribution name, as per http://wiki.ubuntu.com/ErrorTracker#error . Thanks Evan Dandrea.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gtk/apport-gtk'
2--- gtk/apport-gtk 2012-03-07 13:12:34 +0000
3+++ gtk/apport-gtk 2012-03-08 16:51:39 +0000
4@@ -236,6 +236,8 @@
5 Gtk.IconSize.DIALOG)
6
7 d = self.w('dialog_crash_new')
8+ if 'DistroRelease' in self.report:
9+ d.set_title(self.report['DistroRelease'].split()[0])
10 d.set_resizable(False)
11 d.show()
12 # don't steal focus when being called without arguments (i. e.
13
14=== modified file 'kde/apport-kde'
15--- kde/apport-kde 2012-03-02 12:04:25 +0000
16+++ kde/apport-kde 2012-03-08 16:51:39 +0000
17@@ -110,7 +110,10 @@
18 '''Report dialog wrapper'''
19
20 def __init__(self, report, allowed_to_report, ui, desktop_file):
21- Dialog.__init__(self, 'bugreport.ui', '', '', '')
22+ if 'DistroRelease' not in report:
23+ report.add_os_info()
24+ distro = report['DistroRelease']
25+ Dialog.__init__(self, 'bugreport.ui', distro.split()[0], '', '')
26 self.details = self.findChild(QPushButton, 'show_details')
27 self.details.clicked.connect(self.on_show_details_clicked)
28 self.continue_button = self.findChild(QPushButton, 'continue_button')
29@@ -129,9 +132,6 @@
30 self.ui = ui
31 self.collect_called = False
32 icon = None
33- if 'DistroRelease' not in report:
34- report.add_os_info()
35- distro = report['DistroRelease']
36 report_type = report.get('ProblemType')
37
38 self.spinner = QLabel('', parent=self.treeview)
39
40=== modified file 'test/test_ui.py'
41--- test/test_ui.py 2012-03-08 16:27:37 +0000
42+++ test/test_ui.py 2012-03-08 16:51:39 +0000
43@@ -354,6 +354,7 @@
44 self.assertEqual(self.ui.ic_progress_active, False,
45 'progress dialog for package bug info collection finished')
46
47+<<<<<<< TREE
48 def test_collect_info_permissions(self):
49 '''collect_info() leaves the report accessible to the group'''
50
51@@ -363,6 +364,16 @@
52 self.ui.collect_info()
53 self.assertTrue(os.stat(self.report_file.name).st_mode & stat.S_IRGRP)
54
55+=======
56+ def test_collect_info_permissions(self):
57+ '''collect_info() leaves the report accessible to the group'''
58+ self.ui.report = apport.Report('Bug')
59+ self.ui.cur_package = 'bash'
60+ self.ui.report_file = self.report_file.name
61+ self.ui.collect_info()
62+ self.assertTrue(os.stat(self.report_file.name).st_mode & stat.S_IRGRP)
63+
64+>>>>>>> MERGE-SOURCE
65 def test_handle_duplicate(self):
66 '''handle_duplicate()'''
67
68
69=== modified file 'test/test_ui_gtk.py'
70--- test/test_ui_gtk.py 2012-03-07 13:12:34 +0000
71+++ test/test_ui_gtk.py 2012-03-08 16:51:39 +0000
72@@ -57,6 +57,7 @@
73 self.app.report['ExecutablePath'] = '/bin/bash'
74 self.app.report['Signal'] = '11'
75 self.app.report['CoreDump'] = ''
76+ self.app.report['DistroRelease'] = self.distro
77 with open(self.app.report_file, 'w') as f:
78 self.app.report.write(f)
79
80@@ -86,6 +87,8 @@
81 self.app.report['ProblemType'] = 'KernelCrash'
82 GLib.idle_add(Gtk.main_quit)
83 self.app.ui_present_report_details(True)
84+ self.assertEqual(self.app.w('dialog_crash_new').get_title(),
85+ self.distro.split()[0])
86 self.assertEqual(self.app.w('title_label').get_text(),
87 _('Sorry, %s has experienced an internal error.') % self.distro)
88 send_error_report = self.app.w('send_error_report')
89@@ -113,6 +116,8 @@
90 self.app.report['Package'] = 'apport 1.2.3~0ubuntu1'
91 GLib.idle_add(Gtk.main_quit)
92 self.app.ui_present_report_details(True)
93+ self.assertEqual(self.app.w('dialog_crash_new').get_title(),
94+ self.distro.split()[0])
95 self.assertEqual(self.app.w('title_label').get_text(),
96 _('Sorry, a problem occurred while installing software.'))
97 send_error_report = self.app.w('send_error_report')
98@@ -148,6 +153,8 @@
99 self.app.report['DesktopFile'] = fp.name
100 GLib.idle_add(Gtk.main_quit)
101 self.app.ui_present_report_details(True)
102+ self.assertEqual(self.app.w('dialog_crash_new').get_title(),
103+ self.distro.split()[0])
104 self.assertEqual(self.app.w('title_label').get_text(),
105 _('The application Apport has closed unexpectedly.'))
106 send_error_report = self.app.w('send_error_report')
107@@ -176,6 +183,8 @@
108 self.app.report['Package'] = 'bash 5'
109 GLib.idle_add(Gtk.main_quit)
110 self.app.ui_present_report_details(True)
111+ self.assertEqual(self.app.w('dialog_crash_new').get_title(),
112+ self.distro.split()[0])
113 self.assertEqual(self.app.w('title_label').get_text(),
114 _('Sorry, %s has experienced an internal error.') % self.distro)
115 self.assertEqual(self.app.w('subtitle_label').get_text(),
116@@ -212,6 +221,8 @@
117 self.app.cur_package = 'apport'
118 GLib.idle_add(Gtk.main_quit)
119 self.app.ui_present_report_details(True)
120+ self.assertEqual(self.app.w('dialog_crash_new').get_title(),
121+ self.distro.split()[0])
122 self.assertEqual(self.app.w('title_label').get_text(),
123 _('Sorry, the application apport has closed unexpectedly.'))
124 self.assertEqual(self.app.w('subtitle_label').get_text(),
125
126=== modified file 'test/test_ui_kde.py'
127--- test/test_ui_kde.py 2012-03-06 07:25:07 +0000
128+++ test/test_ui_kde.py 2012-03-08 16:51:39 +0000
129@@ -90,6 +90,8 @@
130 self.app.report['ProblemType'] = 'KernelCrash'
131 QTimer.singleShot(0, QCoreApplication.quit)
132 self.app.ui_present_report_details(True)
133+ self.assertEqual(self.app.dialog.windowTitle(),
134+ self.distro.split()[0])
135 self.assertEqual(self.app.dialog.heading.text(),
136 _('Sorry, %s has experienced an internal error.') % self.distro)
137 self.assertTrue(self.app.dialog.send_error_report.isVisible())
138@@ -115,6 +117,8 @@
139 self.app.report['Package'] = 'apport 1.2.3~0ubuntu1'
140 QTimer.singleShot(0, QCoreApplication.quit)
141 self.app.ui_present_report_details(True)
142+ self.assertEqual(self.app.dialog.windowTitle(),
143+ self.distro.split()[0])
144 self.assertEqual(self.app.dialog.heading.text(),
145 _('Sorry, a problem occurred while installing software.'))
146 self.assertTrue(self.app.dialog.send_error_report.isVisible())
147@@ -147,6 +151,8 @@
148 self.app.report['DesktopFile'] = fp.name
149 QTimer.singleShot(0, QCoreApplication.quit)
150 self.app.ui_present_report_details(True)
151+ self.assertEqual(self.app.dialog.windowTitle(),
152+ self.distro.split()[0])
153 self.assertEqual(self.app.dialog.heading.text(),
154 _('The application Apport has closed unexpectedly.'))
155 self.assertTrue(self.app.dialog.send_error_report.isVisible())
156@@ -173,6 +179,8 @@
157 self.app.report['Package'] = 'apport 1.2.3~0ubuntu1'
158 QTimer.singleShot(0, QCoreApplication.quit)
159 self.app.ui_present_report_details(True)
160+ self.assertEqual(self.app.dialog.windowTitle(),
161+ self.distro.split()[0])
162 self.assertEqual(self.app.dialog.heading.text(),
163 _('Sorry, %s has experienced an internal error.') % self.distro)
164 self.assertEqual(self.app.dialog.text.text(),
165@@ -201,6 +209,8 @@
166 self.app.report_file = None
167 QTimer.singleShot(0, QCoreApplication.quit)
168 self.app.ui_present_report_details(True)
169+ self.assertEqual(self.app.dialog.windowTitle(),
170+ self.distro.split()[0])
171 self.assertEqual(self.app.dialog.heading.text(),
172 _('Send problem report to the developers?'))
173 self.assertFalse(self.app.dialog.text.isVisible())

Subscribers

People subscribed via source and target branches