Merge lp:~brian-murray/apport/recoverable-problem-issues into lp:~apport-hackers/apport/trunk

Proposed by Brian Murray
Status: Merged
Merged at revision: 2803
Proposed branch: lp:~brian-murray/apport/recoverable-problem-issues
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 72 lines (+23/-2)
4 files modified
NEWS (+5/-1)
data/recoverable_problem (+6/-0)
data/whoopsie-upload-all (+1/-1)
test/test_recoverable_problem.py (+11/-0)
To merge this branch: bzr merge lp:~brian-murray/apport/recoverable-problem-issues
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+219597@code.launchpad.net

Description of the change

This modifies how a duplicate signature is created for recoverable problems and adds a test for it. It also fixes an issue with whoopsie-upload-all not uploading recoverable problems.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

LGTM, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2014-05-12 14:27:33 +0000
3+++ NEWS 2014-05-14 21:02:54 +0000
4@@ -1,5 +1,5 @@
5 This file summarizes the major and interesting changes for each release. For a
6-detailled list of changes, please see ChangeLog.
7+detailed list of changes, please see ChangeLog.
8
9 2.14.3 (UNRELEASED)
10 -------------------
11@@ -7,6 +7,10 @@
12 Murray. (LP: #1316845)
13 * Add a duplicate signature to suspend resume failures. Thanks Brian Murray.
14 (LP: #1316841)
15+ * Use package name in duplicate signature for recoverable problems. Thanks Brian
16+ Murray. (LP: #1316763)
17+ * Have whoopsie-upload-all upload recoverable problems. Thanks Brian Murray.
18+ (LP: #1319099)
19
20 2.14.2 (2014-04-30)
21 -------------------
22
23=== modified file 'data/recoverable_problem'
24--- data/recoverable_problem 2013-07-23 04:58:15 +0000
25+++ data/recoverable_problem 2014-05-14 21:02:54 +0000
26@@ -56,6 +56,12 @@
27 report.add_os_info()
28 report.add_user_info()
29
30+ ds = report.get('DuplicateSignature', '')
31+ package = report.get('Package', '')
32+ if package and ds:
33+ package = package.split()[0]
34+ report['DuplicateSignature'] = '%s:%s' % (package, ds)
35+
36 # Write the final report
37 with open(apport.fileutils.make_report_path(report), 'wb') as fp:
38 report.write(fp)
39
40=== modified file 'data/whoopsie-upload-all'
41--- data/whoopsie-upload-all 2014-01-09 11:44:29 +0000
42+++ data/whoopsie-upload-all 2014-05-14 21:02:54 +0000
43@@ -44,7 +44,7 @@
44 except Exception as e:
45 sys.stderr.write('ERROR: cannot load %s: %s\n' % (report, str(e)))
46 return None
47- if r.get('ProblemType', '') != 'Crash' or 'ExecutablePath' not in r:
48+ if r.get('ProblemType', '') != 'Crash' and 'ExecutablePath' not in r:
49 print(' skipping, not a crash')
50 return None
51 if 'Dependencies' in r:
52
53=== modified file 'test/test_recoverable_problem.py'
54--- test/test_recoverable_problem.py 2012-07-23 05:05:04 +0000
55+++ test/test_recoverable_problem.py 2014-05-14 21:02:54 +0000
56@@ -58,6 +58,17 @@
57 self.assertEqual(report['hello'], 'there')
58 self.assertTrue('Pid:\t%d' % os.getpid() in report['ProcStatus'])
59
60+ def test_recoverable_problem_dupe_sig(self):
61+ '''recoverable_problem duplicate signature includes package'''
62+
63+ self.call_recoverable_problem('Package\0test\0DuplicateSignature\0ds')
64+ path = self.wait_for_report()
65+ with open(path, 'rb') as report_path:
66+ report = apport.report.Report()
67+ report.load(report_path)
68+ self.assertEqual(report['DuplicateSignature'], 'test:ds')
69+ self.assertTrue('Pid:\t%d' % os.getpid() in report['ProcStatus'])
70+
71 def test_invalid_data(self):
72 '''recoverable_problem with invalid data'''
73

Subscribers

People subscribed via source and target branches