Merge lp:~stevenk/launchpad/death-to-odd-files into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 13910
Proposed branch: lp:~stevenk/launchpad/death-to-odd-files
Merge into: lp:launchpad
Diff against target: 103 lines (+24/-5)
6 files modified
Makefile (+1/-0)
lib/lp/archiveuploader/tests/nascentupload-announcements.txt (+5/-1)
lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt (+6/-0)
lib/lp/archiveuploader/tests/upload-karma.txt (+6/-2)
lib/lp/buildmaster/tests/test_packagebuild.py (+2/-2)
lib/lp/soyuz/scripts/tests/test_queue.py (+4/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/death-to-odd-files
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+74884@code.launchpad.net

Commit message

[r=sinzui][bug=421705] Eliminate the cause of random files leaking into the tree.

Description of the change

The test suite has been leaving random files and directories in our tree for far too long. They have annoyed me for far too long, and they must die.

I have tracked down where the files were being leaked and eliminated the leaks. To help stem the future flow, I have added a bzr status call to the end of make check.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Thank you, thank you, thank you!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2011-08-25 10:31:52 +0000
3+++ Makefile 2011-09-10 09:03:45 +0000
4@@ -101,6 +101,7 @@
5 # Run all tests. test_on_merge.py takes care of setting up the
6 # database.
7 ${PY} -t ./test_on_merge.py $(VERBOSITY) $(TESTOPTS)
8+ bzr status --no-pending
9
10 check_mailman: build
11 # Run all tests, including the Mailman integration
12
13=== modified file 'lib/lp/archiveuploader/tests/nascentupload-announcements.txt'
14--- lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2011-06-28 15:04:29 +0000
15+++ lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2011-09-10 09:03:45 +0000
16@@ -449,6 +449,11 @@
17 >>> notification['Subject']
18 '[ubuntu/hoary-updates] bar 1.0-2 (Waiting for approval)'
19
20+And clean up.
21+
22+ >>> import os
23+ >>> upload_data = datadir('suite/bar_1.0-2')
24+ >>> os.remove(os.path.join(upload_data, 'bar_1.0.orig.tar.gz'))
25
26 UNAPPROVED upload to BACKPORTS via insecure policy will send a notification
27 saying they are waiting for approval:
28@@ -537,7 +542,6 @@
29 Remove orig.tar.gz pumped from librarian to disk during the upload
30 checks:
31
32- >>> import os
33 >>> upload_data = datadir('suite/bar_1.0-4')
34 >>> os.remove(os.path.join(upload_data, 'bar_1.0.orig.tar.gz'))
35
36
37=== modified file 'lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt'
38--- lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt 2011-08-01 05:25:59 +0000
39+++ lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt 2011-09-10 09:03:45 +0000
40@@ -135,3 +135,9 @@
41 -- Daniel Silverstone <daniel.silverstone@canonical.com> Thu, 30 Mar 2006 01:36:14 +0100
42 <BLANKLINE>
43
44+And clean up.
45+
46+ >>> import os
47+ >>> from lp.archiveuploader.tests import datadir
48+ >>> upload_data = datadir('suite/bar_1.0-2')
49+ >>> os.remove(os.path.join(upload_data, 'bar_1.0.orig.tar.gz'))
50
51=== modified file 'lib/lp/archiveuploader/tests/upload-karma.txt'
52--- lib/lp/archiveuploader/tests/upload-karma.txt 2011-06-01 04:57:27 +0000
53+++ lib/lp/archiveuploader/tests/upload-karma.txt 2011-09-10 09:03:45 +0000
54@@ -97,7 +97,11 @@
55 Clean up
56 ========
57
58-Unregister the event listener to make sure we won't interfere in other tests.
59+Unregister the event listener to make sure we won't interfere in other tests,
60+and delete a stray uploaded file.
61
62+ >>> import os
63+ >>> from lp.archiveuploader.tests import datadir
64 >>> karma_helper.unregister_listener()
65-
66+ >>> upload_data = datadir('suite/bar_1.0-2')
67+ >>> os.remove(os.path.join(upload_data, 'bar_1.0.orig.tar.gz'))
68
69=== modified file 'lib/lp/buildmaster/tests/test_packagebuild.py'
70--- lib/lp/buildmaster/tests/test_packagebuild.py 2011-05-16 23:41:48 +0000
71+++ lib/lp/buildmaster/tests/test_packagebuild.py 2011-09-10 09:03:45 +0000
72@@ -9,6 +9,7 @@
73 import hashlib
74 import os
75 import shutil
76+import tempfile
77
78 from storm.store import Store
79 from zope.component import getUtility
80@@ -309,8 +310,7 @@
81 builder.setSlaveForTesting(self.slave)
82
83 # We overwrite the buildmaster root to use a temp directory.
84- tempdir = self.mktemp()
85- os.mkdir(tempdir)
86+ tempdir = tempfile.mkdtemp()
87 self.addCleanup(shutil.rmtree, tempdir)
88 self.upload_root = tempdir
89 tmp_builddmaster_root = """
90
91=== modified file 'lib/lp/soyuz/scripts/tests/test_queue.py'
92--- lib/lp/soyuz/scripts/tests/test_queue.py 2011-08-01 05:25:59 +0000
93+++ lib/lp/soyuz/scripts/tests/test_queue.py 2011-09-10 09:03:45 +0000
94@@ -407,6 +407,10 @@
95 bug_status, 'FIXRELEASED',
96 'Bug status is %s, expected FIXRELEASED')
97
98+ # Clean up.
99+ upload_data = datadir('suite/bar_1.0-2')
100+ os.remove(os.path.join(upload_data, 'bar_1.0.orig.tar.gz'))
101+
102 def testAcceptActionWithMultipleIDs(self):
103 """Check if accepting multiple items at once works.
104