Merge lp:~abentley/launchpad/build-duration into lp:launchpad/db-devel

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 9627
Proposed branch: lp:~abentley/launchpad/build-duration
Merge into: lp:launchpad/db-devel
Diff against target: 231 lines (+43/-20)
9 files modified
database/sampledata/current-dev.sql (+9/-1)
database/sampledata/current.sql (+9/-1)
database/schema/patch-2207-75-0.sql (+9/-0)
lib/lp/buildmaster/tests/test_buildfarmjob.py (+1/-0)
lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+4/-2)
lib/lp/code/model/tests/test_sourcepackagerecipebuild.py (+3/-1)
lib/lp/soyuz/doc/binarypackagebuild.txt (+3/-1)
lib/lp/soyuz/stories/soyuz/xx-builds-pages.txt (+4/-4)
lib/lp/soyuz/tests/test_binarypackagebuild.py (+1/-10)
To merge this branch: bzr merge lp:~abentley/launchpad/build-duration
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) code Approve
Stuart Bishop (community) db Approve
Robert Collins db Pending
Review via email: mp+31655@code.launchpad.net

Description of the change

= Summary =
Fix bug #612899: Some recipe builds have NULL date_started but non-NULL date_finished

== Proposed fix ==
Fix the broken production data before migration by using the
date_first_dispatched (which we have determined is not broken) to synthesize a
build_duration.

Add a constraint to ensure this bug doesn't re-surface.

== Pre-implementation notes ==
Discussed with bigjools

== Implementation details ==
Some of the sampledata was broken, so I fixed it.

== Tests ==
None

== Demo and Q/A ==
None

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  database/sampledata/current.sql
  database/sampledata/current-dev.sql
  database/schema/patch-2207-75-0.sql

./database/schema/patch-2207-75-0.sql
       7: Line exceeds 78 characters.
      10: Line exceeds 78 characters.
      12: Line exceeds 78 characters.
      15: Line exceeds 78 characters.
      18: Line exceeds 78 characters.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

The change looks fine. Note that updating the existing db patch means it will not have effect on staging until the next full database restore (hopefully this weekend).

review: Approve (db)
Revision history for this message
Aaron Bentley (abentley) wrote :

Addendum: I have had to fix several tests that were assuming the presence of bad data (which is now impossible). I deleted test_estimateDuration_with_bad_history because its only purpose was to test behaviour with bad data.

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Hi Aaron,

This branch looks good.

-Edwin

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql 2010-07-30 23:01:04 +0000
+++ database/sampledata/current-dev.sql 2010-08-04 15:21:28 +0000
@@ -1,5 +1,6 @@
1-- Copyright 2010 Canonical Ltd. This software is licensed under the1-- Copyright 2010 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).2-- GNU Affero General Public License version 3 (see the file LICENSE).
3-- Created using pg_dump (PostgreSQL) 8.4.4
34
4SET check_function_bodies = false;5SET check_function_bodies = false;
5SET client_encoding = 'UTF8';6SET client_encoding = 'UTF8';
@@ -2313,7 +2314,7 @@
2313INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (26, 1, true, '2007-07-08 00:00:00', '2007-07-07 23:58:41', '2007-07-08 00:00:01', NULL, 1, 2, 1, 1);2314INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (26, 1, true, '2007-07-08 00:00:00', '2007-07-07 23:58:41', '2007-07-08 00:00:01', NULL, 1, 2, 1, 1);
2314INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (27, 1, true, '2007-07-24 00:00:00', '2007-07-23 23:58:41', '2007-07-24 00:00:01', NULL, 1, 1, 1, 1);2315INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (27, 1, true, '2007-07-24 00:00:00', '2007-07-23 23:58:41', '2007-07-24 00:00:01', NULL, 1, 1, 1, 1);
2315INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (28, 3, true, '2007-08-10 00:00:00', '2007-08-10 00:00:00', '2007-08-10 00:00:13', NULL, 1, 1, 1, 1);2316INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (28, 3, true, '2007-08-10 00:00:00', '2007-08-10 00:00:00', '2007-08-10 00:00:13', NULL, 1, 1, 1, 1);
2316INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (29, 1, false, '2007-08-09 21:54:18.553132', NULL, '2007-08-09 23:59:59', NULL, NULL, 1, NULL, 1);2317INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (29, 1, false, '2007-08-09 21:54:18.553132', '2007-08-09 23:49:59', '2007-08-09 23:59:59', NULL, NULL, 1, NULL, 1);
2317INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (30, 3, false, '2007-08-10 00:00:01', '2007-08-10 00:00:01', '2007-08-10 00:00:14', NULL, 1, 1, 1, 1);2318INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (30, 3, false, '2007-08-10 00:00:01', '2007-08-10 00:00:01', '2007-08-10 00:00:14', NULL, 1, 1, 1, 1);
23182319
23192320
@@ -10543,6 +10544,13 @@
10543ALTER TABLE structuralsubscription ENABLE TRIGGER ALL;10544ALTER TABLE structuralsubscription ENABLE TRIGGER ALL;
1054410545
1054510546
10547ALTER TABLE suggestivepotemplate DISABLE TRIGGER ALL;
10548
10549
10550
10551ALTER TABLE suggestivepotemplate ENABLE TRIGGER ALL;
10552
10553
10546ALTER TABLE teammembership DISABLE TRIGGER ALL;10554ALTER TABLE teammembership DISABLE TRIGGER ALL;
1054710555
10548INSERT INTO teammembership (id, person, team, status, date_joined, date_expires, last_changed_by, last_change_comment, proposed_by, acknowledged_by, reviewed_by, date_proposed, date_last_changed, date_acknowledged, date_reviewed, proponent_comment, acknowledger_comment, reviewer_comment, date_created) VALUES (1, 1, 17, 3, '2005-03-03 10:02:53.830191', '2050-03-03 10:02:53.830191', NULL, NULL, 1, NULL, 1, '2005-03-03 10:02:53.830191', NULL, NULL, '2005-03-03 10:02:53.830191', NULL, NULL, NULL, '2008-02-15 13:59:16.98918');10556INSERT INTO teammembership (id, person, team, status, date_joined, date_expires, last_changed_by, last_change_comment, proposed_by, acknowledged_by, reviewed_by, date_proposed, date_last_changed, date_acknowledged, date_reviewed, proponent_comment, acknowledger_comment, reviewer_comment, date_created) VALUES (1, 1, 17, 3, '2005-03-03 10:02:53.830191', '2050-03-03 10:02:53.830191', NULL, NULL, 1, NULL, 1, '2005-03-03 10:02:53.830191', NULL, NULL, '2005-03-03 10:02:53.830191', NULL, NULL, NULL, '2008-02-15 13:59:16.98918');
1054910557
=== modified file 'database/sampledata/current.sql'
--- database/sampledata/current.sql 2010-07-30 23:01:04 +0000
+++ database/sampledata/current.sql 2010-08-04 15:21:28 +0000
@@ -1,5 +1,6 @@
1-- Copyright 2010 Canonical Ltd. This software is licensed under the1-- Copyright 2010 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).2-- GNU Affero General Public License version 3 (see the file LICENSE).
3-- Created using pg_dump (PostgreSQL) 8.4.4
34
4SET check_function_bodies = false;5SET check_function_bodies = false;
5SET client_encoding = 'UTF8';6SET client_encoding = 'UTF8';
@@ -2270,7 +2271,7 @@
2270INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (26, 1, true, '2007-07-08 00:00:00', '2007-07-07 23:58:41', '2007-07-08 00:00:01', NULL, 1, 2, 1, 1);2271INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (26, 1, true, '2007-07-08 00:00:00', '2007-07-07 23:58:41', '2007-07-08 00:00:01', NULL, 1, 2, 1, 1);
2271INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (27, 1, true, '2007-07-24 00:00:00', '2007-07-23 23:58:41', '2007-07-24 00:00:01', NULL, 1, 1, 1, 1);2272INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (27, 1, true, '2007-07-24 00:00:00', '2007-07-23 23:58:41', '2007-07-24 00:00:01', NULL, 1, 1, 1, 1);
2272INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (28, 3, true, '2007-08-10 00:00:00', '2007-08-10 00:00:00', '2007-08-10 00:00:13', NULL, 1, 1, 1, 1);2273INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (28, 3, true, '2007-08-10 00:00:00', '2007-08-10 00:00:00', '2007-08-10 00:00:13', NULL, 1, 1, 1, 1);
2273INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (29, 1, false, '2007-08-09 21:54:18.553132', NULL, '2007-08-09 23:59:59', NULL, NULL, 1, NULL, 1);2274INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (29, 1, false, '2007-08-09 21:54:18.553132', '2007-08-09 23:49:59', '2007-08-09 23:59:59', NULL, NULL, 1, NULL, 1);
2274INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (30, 3, false, '2007-08-10 00:00:01', '2007-08-10 00:00:01', '2007-08-10 00:00:14', NULL, 1, 1, 1, 1);2275INSERT INTO buildfarmjob (id, processor, virtualized, date_created, date_started, date_finished, date_first_dispatched, builder, status, log, job_type) VALUES (30, 3, false, '2007-08-10 00:00:01', '2007-08-10 00:00:01', '2007-08-10 00:00:14', NULL, 1, 1, 1, 1);
22752276
22762277
@@ -10413,6 +10414,13 @@
10413ALTER TABLE structuralsubscription ENABLE TRIGGER ALL;10414ALTER TABLE structuralsubscription ENABLE TRIGGER ALL;
1041410415
1041510416
10417ALTER TABLE suggestivepotemplate DISABLE TRIGGER ALL;
10418
10419
10420
10421ALTER TABLE suggestivepotemplate ENABLE TRIGGER ALL;
10422
10423
10416ALTER TABLE teammembership DISABLE TRIGGER ALL;10424ALTER TABLE teammembership DISABLE TRIGGER ALL;
1041710425
10418INSERT INTO teammembership (id, person, team, status, date_joined, date_expires, last_changed_by, last_change_comment, proposed_by, acknowledged_by, reviewed_by, date_proposed, date_last_changed, date_acknowledged, date_reviewed, proponent_comment, acknowledger_comment, reviewer_comment, date_created) VALUES (1, 1, 17, 3, '2005-03-03 10:02:53.830191', '2050-03-03 10:02:53.830191', NULL, NULL, 1, NULL, 1, '2005-03-03 10:02:53.830191', NULL, NULL, '2005-03-03 10:02:53.830191', NULL, NULL, NULL, '2008-02-15 13:59:16.98918');10426INSERT INTO teammembership (id, person, team, status, date_joined, date_expires, last_changed_by, last_change_comment, proposed_by, acknowledged_by, reviewed_by, date_proposed, date_last_changed, date_acknowledged, date_reviewed, proponent_comment, acknowledger_comment, reviewer_comment, date_created) VALUES (1, 1, 17, 3, '2005-03-03 10:02:53.830191', '2050-03-03 10:02:53.830191', NULL, NULL, 1, NULL, 1, '2005-03-03 10:02:53.830191', NULL, NULL, '2005-03-03 10:02:53.830191', NULL, NULL, NULL, '2008-02-15 13:59:16.98918');
1041910427
=== modified file 'database/schema/patch-2207-75-0.sql'
--- database/schema/patch-2207-75-0.sql 2010-07-30 10:08:40 +0000
+++ database/schema/patch-2207-75-0.sql 2010-08-04 15:21:28 +0000
@@ -3,6 +3,9 @@
33
4SET client_min_messages=ERROR;4SET client_min_messages=ERROR;
55
6-- Fix broken production data
7UPDATE SourcePackageRecipeBuild SET build_duration = date_built - date_first_dispatched WHERE build_duration is NULL;
8
6CREATE TEMPORARY TABLE NewBuildFarmJob AS SELECT9CREATE TEMPORARY TABLE NewBuildFarmJob AS SELECT
7 nextval('buildfarmjob_id_seq') AS id, 1 AS processor, True AS virtualized, date_created, date_built - build_duration AS date_started, date_built AS date_finished, date_first_dispatched, builder, build_state, build_log, 3 AS job_type, id AS sprb_id FROM SourcePackageRecipeBuild;10 nextval('buildfarmjob_id_seq') AS id, 1 AS processor, True AS virtualized, date_created, date_built - build_duration AS date_started, date_built AS date_finished, date_first_dispatched, builder, build_state, build_log, 3 AS job_type, id AS sprb_id FROM SourcePackageRecipeBuild;
811
@@ -29,4 +32,10 @@
29 DROP COLUMN build_state, DROP COLUMN build_log, DROP COLUMN archive,32 DROP COLUMN build_state, DROP COLUMN build_log, DROP COLUMN archive,
30 DROP COLUMN pocket, DROP COLUMN upload_log, DROP COLUMN dependencies;33 DROP COLUMN pocket, DROP COLUMN upload_log, DROP COLUMN dependencies;
3134
35
36ALTER TABLE BuildFarmJob
37 ADD CONSTRAINT started_if_finished CHECK (
38 date_finished IS NULL OR date_started IS NOT NULL);
39
40
32INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 75, 0);41INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 75, 0);
3342
=== modified file 'lib/lp/buildmaster/tests/test_buildfarmjob.py'
--- lib/lp/buildmaster/tests/test_buildfarmjob.py 2010-07-18 17:43:23 +0000
+++ lib/lp/buildmaster/tests/test_buildfarmjob.py 2010-08-04 15:21:28 +0000
@@ -49,6 +49,7 @@
49 build_farm_job = getUtility(IBuildFarmJobSource).new(49 build_farm_job = getUtility(IBuildFarmJobSource).new(
50 job_type=job_type, status=status)50 job_type=job_type, status=status)
51 removeSecurityProxy(build_farm_job).builder = builder51 removeSecurityProxy(build_farm_job).builder = builder
52 removeSecurityProxy(build_farm_job).date_started = date_finished
52 removeSecurityProxy(build_farm_job).date_finished = date_finished53 removeSecurityProxy(build_farm_job).date_finished = date_finished
53 return build_farm_job54 return build_farm_job
5455
5556
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2010-07-31 20:55:46 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2010-08-04 15:21:28 +0000
@@ -515,6 +515,7 @@
515 build = removeSecurityProxy(self.factory.makeSourcePackageRecipeBuild(515 build = removeSecurityProxy(self.factory.makeSourcePackageRecipeBuild(
516 recipe=recipe, distroseries=self.squirrel, archive=self.ppa))516 recipe=recipe, distroseries=self.squirrel, archive=self.ppa))
517 build.status = BuildStatus.FULLYBUILT517 build.status = BuildStatus.FULLYBUILT
518 build.date_started = datetime(2010, 03, 16, tzinfo=utc)
518 build.date_finished = datetime(2010, 03, 16, tzinfo=utc)519 build.date_finished = datetime(2010, 03, 16, tzinfo=utc)
519520
520 self.assertTextMatchesExpressionIgnoreWhitespace("""\521 self.assertTextMatchesExpressionIgnoreWhitespace("""\
@@ -596,8 +597,9 @@
596 set(view.builds))597 set(view.builds))
597598
598 def set_day(build, day):599 def set_day(build, day):
599 removeSecurityProxy(build).date_finished = datetime(600 naked_build = removeSecurityProxy(build)
600 2010, 03, day, tzinfo=utc)601 naked_build.date_started = datetime(2010, 03, day, tzinfo=utc)
602 naked_build.date_finished = datetime(2010, 03, day, tzinfo=utc)
601 set_day(build1, 16)603 set_day(build1, 16)
602 set_day(build2, 15)604 set_day(build2, 15)
603 # When there are 4+ pending builds, only the the most605 # When there are 4+ pending builds, only the the most
604606
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2010-08-03 08:49:19 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2010-08-04 15:21:28 +0000
@@ -326,7 +326,9 @@
326 def prepare_build():326 def prepare_build():
327 queue_record = self.factory.makeSourcePackageRecipeBuildJob()327 queue_record = self.factory.makeSourcePackageRecipeBuildJob()
328 build = queue_record.specific_job.build328 build = queue_record.specific_job.build
329 removeSecurityProxy(build).status = BuildStatus.FULLYBUILT329 naked_build = removeSecurityProxy(build)
330 naked_build.status = BuildStatus.FULLYBUILT
331 naked_build.date_started = self.factory.getUniqueDate()
330 queue_record.builder = self.factory.makeBuilder()332 queue_record.builder = self.factory.makeBuilder()
331 slave = WaitingSlave('BuildStatus.OK')333 slave = WaitingSlave('BuildStatus.OK')
332 queue_record.builder.setSlaveForTesting(slave)334 queue_record.builder.setSlaveForTesting(slave)
333335
=== modified file 'lib/lp/soyuz/doc/binarypackagebuild.txt'
--- lib/lp/soyuz/doc/binarypackagebuild.txt 2010-07-23 09:04:18 +0000
+++ lib/lp/soyuz/doc/binarypackagebuild.txt 2010-08-04 15:21:28 +0000
@@ -1200,7 +1200,7 @@
1200 >>> properties = {1200 >>> properties = {
1201 ... 'log': 1,1201 ... 'log': 1,
1202 ... 'date_finished': UTC_NOW,1202 ... 'date_finished': UTC_NOW,
1203 ... 'date_started': None,1203 ... 'date_started': UTC_NOW,
1204 ... 'builder': bob,1204 ... 'builder': bob,
1205 ... 'status': BuildStatus.FAILEDTOUPLOAD,1205 ... 'status': BuildStatus.FAILEDTOUPLOAD,
1206 ... 'dependencies': u'whatever',1206 ... 'dependencies': u'whatever',
@@ -1417,10 +1417,12 @@
1417 >>> earlier_builds = src_pkg_earlier.createMissingBuilds()1417 >>> earlier_builds = src_pkg_earlier.createMissingBuilds()
1418 >>> eg_build_date = earlier_builds[0].date_created1418 >>> eg_build_date = earlier_builds[0].date_created
1419 >>> for build in earlier_builds:1419 >>> for build in earlier_builds:
1420 ... build.date_started = eg_build_date - timedelta(1)
1420 ... build.date_finished = eg_build_date - timedelta(1)1421 ... build.date_finished = eg_build_date - timedelta(1)
14211422
1422 >>> later_builds = src_pkg_later.createMissingBuilds()1423 >>> later_builds = src_pkg_later.createMissingBuilds()
1423 >>> for build in later_builds:1424 >>> for build in later_builds:
1425 ... build.date_started = eg_build_date
1424 ... build.date_finished = eg_build_date1426 ... build.date_finished = eg_build_date
14251427
1426 Ensure that the i386 builds are created by the 'frog' builder,1428 Ensure that the i386 builds are created by the 'frog' builder,
14271429
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-builds-pages.txt'
--- lib/lp/soyuz/stories/soyuz/xx-builds-pages.txt 2010-04-14 17:34:35 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-builds-pages.txt 2010-08-04 15:21:28 +0000
@@ -143,8 +143,8 @@
143 ------------------------------143 ------------------------------
144 Successfully built144 Successfully built
145 i386 build of commercialpackage 1.0-1 in ubuntu breezy-autotest RELEASE145 i386 build of commercialpackage 1.0-1 in ubuntu breezy-autotest RELEASE
146 Build started at an unknown time on an unknown build machine and finished146 Build started on 2007-08-09 on an unknown build machine and finished
147 on 2007-08-09 taking147 on 2007-08-09 taking ten minutes
148 ------------------------------148 ------------------------------
149 Failed to upload149 Failed to upload
150 i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE150 i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE
@@ -200,8 +200,8 @@
200 ------------------------------200 ------------------------------
201 Successfully built201 Successfully built
202 i386 build of commercialpackage 1.0-1 in ubuntu breezy-autotest RELEASE202 i386 build of commercialpackage 1.0-1 in ubuntu breezy-autotest RELEASE
203 Build started at an unknown time on an unknown build machine and finished203 Build started on 2007-08-09 on an unknown build machine and finished
204 on 2007-08-09 taking204 on 2007-08-09 taking ten minutes
205 ------------------------------205 ------------------------------
206 Successfully built206 Successfully built
207 i386 build of pmount 0.1-1 in ubuntu hoary RELEASE207 i386 build of pmount 0.1-1 in ubuntu hoary RELEASE
208208
=== modified file 'lib/lp/soyuz/tests/test_binarypackagebuild.py'
--- lib/lp/soyuz/tests/test_binarypackagebuild.py 2010-07-21 07:45:50 +0000
+++ lib/lp/soyuz/tests/test_binarypackagebuild.py 2010-08-04 15:21:28 +0000
@@ -10,7 +10,6 @@
10from zope.component import getUtility10from zope.component import getUtility
11from zope.security.proxy import removeSecurityProxy11from zope.security.proxy import removeSecurityProxy
1212
13from canonical.database.constants import UTC_NOW
14from canonical.testing import LaunchpadZopelessLayer13from canonical.testing import LaunchpadZopelessLayer
15from lp.services.job.model.job import Job14from lp.services.job.model.job import Job
16from lp.buildmaster.interfaces.buildbase import BuildStatus15from lp.buildmaster.interfaces.buildbase import BuildStatus
@@ -83,13 +82,6 @@
83 self.create_previous_build(335)82 self.create_previous_build(335)
84 self.assertEqual(335, self.build.estimateDuration().seconds)83 self.assertEqual(335, self.build.estimateDuration().seconds)
8584
86 def test_estimateDuration_with_bad_history(self):
87 # If the latest matching build has bad data, ignore it.
88 # See bug 589068.
89 previous_build = self.create_previous_build(335)
90 previous_build.date_started = None
91 self.assertEqual(60, self.build.estimateDuration().seconds)
92
93 def addFakeBuildLog(self):85 def addFakeBuildLog(self):
94 lfa = self.factory.makeLibraryFileAlias('mybuildlog.txt')86 lfa = self.factory.makeLibraryFileAlias('mybuildlog.txt')
95 removeSecurityProxy(self.build).log = lfa87 removeSecurityProxy(self.build).log = lfa
@@ -418,8 +410,7 @@
418410
419 self.builder = self.factory.makeBuilder()411 self.builder = self.factory.makeBuilder()
420 self.builder.setSlaveForTesting(WaitingSlave('BuildStatus.OK'))412 self.builder.setSlaveForTesting(WaitingSlave('BuildStatus.OK'))
421 self.build.buildqueue_record.builder = self.builder413 self.build.buildqueue_record.markAsBuilding(self.builder)
422 self.build.buildqueue_record.setDateStarted(UTC_NOW)
423414
424 def testDependencies(self):415 def testDependencies(self):
425 """Verify that storeBuildInfo sets any dependencies."""416 """Verify that storeBuildInfo sets any dependencies."""

Subscribers

People subscribed via source and target branches

to status/vote changes: