comparison test/test_listpackages.py @ 252:2e0b373414b8

Make bin/listpackages.py ignore revisions that have not been built successfully, unless the revision has been explicitly selected. Add a test case for this.
author Bernhard Herzog <bh@intevation.de>
date Tue, 14 Apr 2009 09:41:59 +0000
parents 243f206574cb
children 7d932fac1055
comparison
equal deleted inserted replaced
251:243f206574cb 252:2e0b373414b8
28 build_duration = timedelta(minutes=30) 28 build_duration = timedelta(minutes=30)
29 check_interval = timedelta(minutes=60) 29 check_interval = timedelta(minutes=60)
30 30
31 package_dirs = [] 31 package_dirs = []
32 for revision in revisions: 32 for revision in revisions:
33 rev, rules_rev = revision
34 status = RevisionStatus(None) 33 status = RevisionStatus(None)
35 status.binary_package_created() 34 if len(revision) == 2:
35 rev, rules_rev = revision
36 status.binary_package_created()
37 else:
38 rev, rules_rev, status_name = revision
39 getattr(status, status_name)()
40
36 status.start = start_time 41 status.start = start_time
37 status.stop = start_time + build_duration 42 status.stop = start_time + build_duration
38 start_time += check_interval 43 start_time += check_interval
39 44
45 if status.status.finished and not status.status.error:
46 src_files = [(template % (rev,), "") for template in src_templates]
47 bin_files = [(template % (rev,), "") for template in bin_templates]
48 else:
49 src_files = []
50 bin_files = []
51
40 package_dirs.append(("%s-%s" % (rev, rules_rev), 52 package_dirs.append(("%s-%s" % (rev, rules_rev),
41 [("status", "".join(status.serialize())), 53 [("status", "".join(status.serialize())),
42 ("src", [(template % (rev,), "") 54 ("src", src_files),
43 for template in src_templates]), 55 ("binary", bin_files)]))
44 ("binary", [(template % (rev,), "")
45 for template in bin_templates])]))
46 return (track, 56 return (track,
47 [("pkg", 57 [("pkg",
48 package_dirs)]) 58 package_dirs)])
49 59
50 60
160 kdepim/pkg/702432-47/binary/kdepim_1.0.1.702432-1_i386.deb 170 kdepim/pkg/702432-47/binary/kdepim_1.0.1.702432-1_i386.deb
161 kdepim/pkg/702432-47/binary/kleopatra_1.0.1.702432-1_i386.deb 171 kdepim/pkg/702432-47/binary/kleopatra_1.0.1.702432-1_i386.deb
162 """) 172 """)
163 173
164 174
175 class TestListPackagesTrackNoRevisionWithIncompleteBuilds(ListPackagesTest):
176
177 track_files = [package_track_files("kdepim", "1.0.1",
178 ["kdepim", "kleopatra"],
179 [(702432, 47),
180 (704195, 31, "error")])]
181
182 def test_listpackages_source(self):
183 self.check_cmd(["--track=kdepim", "--source"],
184 """\
185 kdepim/pkg/702432-47/src/kdepim_1.0.1.702432-1.diff.gz
186 kdepim/pkg/702432-47/src/kdepim_1.0.1.702432-1.dsc
187 kdepim/pkg/702432-47/src/kdepim_1.0.1.702432.orig.tar.gz
188 """)
189
190 def test_listpackages_binary(self):
191 self.check_cmd(["--track=kdepim", "--binary"],
192 """\
193 kdepim/pkg/702432-47/binary/kdepim_1.0.1.702432-1_i386.deb
194 kdepim/pkg/702432-47/binary/kleopatra_1.0.1.702432-1_i386.deb
195 """)
196
197
165 class TestListPackagesNoTrackNoRevision(ListPackagesTest): 198 class TestListPackagesNoTrackNoRevision(ListPackagesTest):
166 199
167 track_files = [package_track_files("kdepim", "1.0.1", 200 track_files = [package_track_files("kdepim", "1.0.1",
168 ["kdepim", "kleopatra"], 201 ["kdepim", "kleopatra"],
169 [(702432, 47), 202 [(702432, 47),
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)