launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #27897
[Merge] ~cjwatson/launchpad:sprint-timebombs into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:sprint-timebombs into launchpad:master.
Commit message:
Remove some timebombs from sprint tests
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/413755
These would otherwise have started failing in a couple of years.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:sprint-timebombs into launchpad:master.
diff --git a/database/sampledata/current-dev.sql b/database/sampledata/current-dev.sql
index 56cdf56..9cee7b7 100644
--- a/database/sampledata/current-dev.sql
+++ b/database/sampledata/current-dev.sql
@@ -9916,9 +9916,7 @@ ALTER TABLE spokenin ENABLE TRIGGER ALL;
ALTER TABLE sprint DISABLE TRIGGER ALL;
INSERT INTO sprint (id, owner, name, title, summary, home_page, address, time_zone, time_starts, time_ends, datecreated, driver, homepage_content, icon, mugshot, logo, is_physical) VALUES (1, 12, 'ubz', 'Ubuntu Below Zero', 'This is the next Ubuntu developer Summit. Join us in Montreal for discussions around Ubuntu and Launchpad. The focus will be the road to Dapper, our April 2006 release, focused on the enterprise.', 'http://wiki.ubuntu.com/UbuntuBelowZero', 'Montreal, Canada', 'US/Eastern', '2005-10-07 23:30:00', '2005-11-17 00:11:00', '2005-09-15 09:04:01.762108', NULL, NULL, NULL, NULL, NULL, true);
-INSERT INTO sprint (id, owner, name, title, summary, home_page, address, time_zone, time_starts, time_ends, datecreated, driver, homepage_content, icon, mugshot, logo, is_physical) VALUES (2, 1, 'uds-guacamole', 'Ubuntu DevSummit Guacamole', 'This is the ubuntu Developer Summit in the town of Guacamole. Expected to be a big hit with the avocado crowd, UDS-Guacamole is going down in future as a way of ensuring that tests continue to pass for a decent length of time.', NULL, NULL, 'UTC', '2024-05-24 14:00:00', '2026-04-23 15:00:00', '2006-06-24 14:16:51.130113', NULL, NULL, NULL, NULL, NULL, true);
-INSERT INTO sprint (id, owner, name, title, summary, home_page, address, time_zone, time_starts, time_ends, datecreated, driver, homepage_content, icon, mugshot, logo, is_physical) VALUES (3, 1, 'paris', 'Ubuntu Summit - Paris', 'This is the ubuntu Developer Summit in Paris, which will be our second visit to the CDG airport.', NULL, NULL, 'UTC', '2011-05-24 14:00:00', '2011-05-28 15:00:00', '2006-07-24 14:16:51.130113', 12, NULL, NULL, NULL, NULL, true);
-INSERT INTO sprint (id, owner, name, title, summary, home_page, address, time_zone, time_starts, time_ends, datecreated, driver, homepage_content, icon, mugshot, logo, is_physical) VALUES (4, 16, 'futurista', 'Future Mega Meeting', 'This very large meeting will cover work on Firefox as well as Ubuntu and Kubuntu. We will use this sprint to test the ability to generate lists of future events for products, projects and distributions.', NULL, NULL, 'Australia/Tasmania', '2025-08-16 23:00:00', '2025-08-23 07:00:00', '2007-02-23 11:14:08.888996', NULL, NULL, NULL, NULL, NULL, true);
+INSERT INTO sprint (id, owner, name, title, summary, home_page, address, time_zone, time_starts, time_ends, datecreated, driver, homepage_content, icon, mugshot, logo, is_physical) VALUES (2, 1, 'paris', 'Ubuntu Summit - Paris', 'This is the ubuntu Developer Summit in Paris, which will be our second visit to the CDG airport.', NULL, NULL, 'UTC', '2011-05-24 14:00:00', '2011-05-28 15:00:00', '2006-07-24 14:16:51.130113', 12, NULL, NULL, NULL, NULL, true);
ALTER TABLE sprint ENABLE TRIGGER ALL;
@@ -9942,8 +9940,6 @@ ALTER TABLE sprintspecification DISABLE TRIGGER ALL;
INSERT INTO sprintspecification (id, sprint, specification, status, whiteboard, registrant, date_created, decider, date_decided) VALUES (1, 1, 3, 10, NULL, 16, '2006-08-05 23:54:10.835093', 12, '2006-08-05 23:54:10.835093');
INSERT INTO sprintspecification (id, sprint, specification, status, whiteboard, registrant, date_created, decider, date_decided) VALUES (2, 1, 1, 10, NULL, 16, '2006-08-05 23:54:10.835093', 12, '2006-08-05 23:54:10.835093');
INSERT INTO sprintspecification (id, sprint, specification, status, whiteboard, registrant, date_created, decider, date_decided) VALUES (3, 1, 4, 10, NULL, 16, '2006-08-05 23:54:10.835093', 12, '2006-08-05 23:54:10.835093');
-INSERT INTO sprintspecification (id, sprint, specification, status, whiteboard, registrant, date_created, decider, date_decided) VALUES (4, 4, 6, 10, NULL, 16, '2007-02-23 11:44:50.663913', 16, '2007-02-23 11:44:50.663913');
-INSERT INTO sprintspecification (id, sprint, specification, status, whiteboard, registrant, date_created, decider, date_decided) VALUES (5, 4, 5, 10, NULL, 16, '2007-02-23 11:45:24.161811', 16, '2007-02-23 11:45:24.161811');
ALTER TABLE sprintspecification ENABLE TRIGGER ALL;
diff --git a/database/sampledata/current.sql b/database/sampledata/current.sql
index df050c1..aa71764 100644
--- a/database/sampledata/current.sql
+++ b/database/sampledata/current.sql
@@ -9830,9 +9830,7 @@ ALTER TABLE spokenin ENABLE TRIGGER ALL;
ALTER TABLE sprint DISABLE TRIGGER ALL;
INSERT INTO sprint (id, owner, name, title, summary, home_page, address, time_zone, time_starts, time_ends, datecreated, driver, homepage_content, icon, mugshot, logo, is_physical) VALUES (1, 12, 'ubz', 'Ubuntu Below Zero', 'This is the next Ubuntu developer Summit. Join us in Montreal for discussions around Ubuntu and Launchpad. The focus will be the road to Dapper, our April 2006 release, focused on the enterprise.', 'http://wiki.ubuntu.com/UbuntuBelowZero', 'Montreal, Canada', 'US/Eastern', '2005-10-07 23:30:00', '2005-11-17 00:11:00', '2005-09-15 09:04:01.762108', NULL, NULL, NULL, NULL, NULL, true);
-INSERT INTO sprint (id, owner, name, title, summary, home_page, address, time_zone, time_starts, time_ends, datecreated, driver, homepage_content, icon, mugshot, logo, is_physical) VALUES (2, 1, 'uds-guacamole', 'Ubuntu DevSummit Guacamole', 'This is the ubuntu Developer Summit in the town of Guacamole. Expected to be a big hit with the avocado crowd, UDS-Guacamole is going down in future as a way of ensuring that tests continue to pass for a decent length of time.', NULL, NULL, 'UTC', '2024-05-24 14:00:00', '2026-04-23 15:00:00', '2006-06-24 14:16:51.130113', NULL, NULL, NULL, NULL, NULL, true);
-INSERT INTO sprint (id, owner, name, title, summary, home_page, address, time_zone, time_starts, time_ends, datecreated, driver, homepage_content, icon, mugshot, logo, is_physical) VALUES (3, 1, 'paris', 'Ubuntu Summit - Paris', 'This is the ubuntu Developer Summit in Paris, which will be our second visit to the CDG airport.', NULL, NULL, 'UTC', '2011-05-24 14:00:00', '2011-05-28 15:00:00', '2006-07-24 14:16:51.130113', 12, NULL, NULL, NULL, NULL, true);
-INSERT INTO sprint (id, owner, name, title, summary, home_page, address, time_zone, time_starts, time_ends, datecreated, driver, homepage_content, icon, mugshot, logo, is_physical) VALUES (4, 16, 'futurista', 'Future Mega Meeting', 'This very large meeting will cover work on Firefox as well as Ubuntu and Kubuntu. We will use this sprint to test the ability to generate lists of future events for products, projects and distributions.', NULL, NULL, 'Australia/Tasmania', '2025-08-16 23:00:00', '2025-08-23 07:00:00', '2007-02-23 11:14:08.888996', NULL, NULL, NULL, NULL, NULL, true);
+INSERT INTO sprint (id, owner, name, title, summary, home_page, address, time_zone, time_starts, time_ends, datecreated, driver, homepage_content, icon, mugshot, logo, is_physical) VALUES (2, 1, 'paris', 'Ubuntu Summit - Paris', 'This is the ubuntu Developer Summit in Paris, which will be our second visit to the CDG airport.', NULL, NULL, 'UTC', '2011-05-24 14:00:00', '2011-05-28 15:00:00', '2006-07-24 14:16:51.130113', 12, NULL, NULL, NULL, NULL, true);
ALTER TABLE sprint ENABLE TRIGGER ALL;
@@ -9856,8 +9854,6 @@ ALTER TABLE sprintspecification DISABLE TRIGGER ALL;
INSERT INTO sprintspecification (id, sprint, specification, status, whiteboard, registrant, date_created, decider, date_decided) VALUES (1, 1, 3, 10, NULL, 16, '2006-08-05 23:54:10.835093', 12, '2006-08-05 23:54:10.835093');
INSERT INTO sprintspecification (id, sprint, specification, status, whiteboard, registrant, date_created, decider, date_decided) VALUES (2, 1, 1, 10, NULL, 16, '2006-08-05 23:54:10.835093', 12, '2006-08-05 23:54:10.835093');
INSERT INTO sprintspecification (id, sprint, specification, status, whiteboard, registrant, date_created, decider, date_decided) VALUES (3, 1, 4, 10, NULL, 16, '2006-08-05 23:54:10.835093', 12, '2006-08-05 23:54:10.835093');
-INSERT INTO sprintspecification (id, sprint, specification, status, whiteboard, registrant, date_created, decider, date_decided) VALUES (4, 4, 6, 10, NULL, 16, '2007-02-23 11:44:50.663913', 16, '2007-02-23 11:44:50.663913');
-INSERT INTO sprintspecification (id, sprint, specification, status, whiteboard, registrant, date_created, decider, date_decided) VALUES (5, 4, 5, 10, NULL, 16, '2007-02-23 11:45:24.161811', 16, '2007-02-23 11:45:24.161811');
ALTER TABLE sprintspecification ENABLE TRIGGER ALL;
diff --git a/lib/lp/blueprints/doc/sprint-agenda.txt b/lib/lp/blueprints/doc/sprint-agenda.txt
index a7e3908..238d4bc 100644
--- a/lib/lp/blueprints/doc/sprint-agenda.txt
+++ b/lib/lp/blueprints/doc/sprint-agenda.txt
@@ -8,12 +8,11 @@ decline those topics.
First, lets get hold of some people, a product, a sprint and a spec.
- >>> from lp.blueprints.model.sprint import SprintSet
>>> from lp.registry.model.person import PersonSet
>>> from lp.registry.model.product import ProductSet
>>> upstream_firefox = ProductSet()['firefox']
>>> canvas = upstream_firefox.getSpecification('canvas')
- >>> guacamole = SprintSet()['uds-guacamole']
+ >>> guacamole = factory.makeSprint(name='uds-guacamole')
>>> danner = PersonSet().getByName('danner')
>>> jblack = PersonSet().getByName('jblack')
diff --git a/lib/lp/blueprints/doc/sprint.txt b/lib/lp/blueprints/doc/sprint.txt
index bd712b3..a4b994e 100644
--- a/lib/lp/blueprints/doc/sprint.txt
+++ b/lib/lp/blueprints/doc/sprint.txt
@@ -3,6 +3,11 @@ Sprints / Meetings
Sprints or meetings can be coordinated using Launchpad.
+ >>> from datetime import (
+ ... datetime,
+ ... timedelta,
+ ... )
+ >>> import pytz
>>> from zope.component import getUtility
>>> from lp.blueprints.interfaces.sprint import ISprintSet
>>> from lp.registry.interfaces.person import IPersonSet
@@ -26,36 +31,46 @@ properties which give us the sprints relevant to them.
>>> ubuntu = distroset.getByName('ubuntu')
>>> mozilla = projectset.getByName('mozilla')
+Make a new sprint and add some relevant specifications to it.
+
+ >>> futurista = factory.makeSprint(
+ ... name='futurista',
+ ... time_starts=datetime.now(pytz.UTC) + timedelta(days=1))
+ >>> firefox_spec = firefox.specifications(futurista.owner)[0]
+ >>> _ = firefox_spec.linkSprint(futurista, futurista.owner)
+ >>> ubuntu_spec = ubuntu.specifications(futurista.owner)[0]
+ >>> _ = ubuntu_spec.linkSprint(futurista, futurista.owner)
+
We have coming_sprints, giving us up to 5 relevant events that are up-
and-coming (sorted by the starting date):
>>> for sprint in firefox.coming_sprints:
... print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
- futurista 2025-08-16
+ futurista ...-...-...
>>> for sprint in ubuntu.coming_sprints:
... print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
- futurista 2025-08-16
+ futurista ...-...-...
>>> for sprint in mozilla.coming_sprints:
... print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
- futurista 2025-08-16
+ futurista ...-...-...
And we have sprints, giving us all sprints relevant to that pillar
(sorted descending by the starting date):
>>> for sprint in firefox.sprints:
... print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
- futurista 2025-08-16
+ futurista ...-...-...
ubz 2005-10-07
>>> for sprint in ubuntu.sprints:
... print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
- futurista 2025-08-16
+ futurista ...-...-...
>>> for sprint in mozilla.sprints:
... print(sprint.name, sprint.time_starts.strftime('%Y-%m-%d'))
- futurista 2025-08-16
+ futurista ...-...-...
ubz 2005-10-07
We also have past_sprints, giving all sprints relevant to that pillar
@@ -218,13 +233,9 @@ Sprint attendance
The sprint attend() method adds a user's attendance to a sprint.
- >>> import datetime
- >>> import pytz
-
>>> person = factory.makePerson(name='mustard')
- >>> UTC = pytz.timezone('UTC')
- >>> time_starts = datetime.datetime(2005, 10, 7, 9, 0, 0, 0, UTC)
- >>> time_ends = datetime.datetime(2005, 10, 17, 19, 5, 0, 0, UTC)
+ >>> time_starts = datetime(2005, 10, 7, 9, 0, 0, 0, pytz.UTC)
+ >>> time_ends = datetime(2005, 10, 17, 19, 5, 0, 0, pytz.UTC)
>>> sprint_attendance = ubz.attend(person, time_starts, time_ends, True)
The attend() method can update a user's attendance if there is already a
@@ -242,8 +253,8 @@ ISprintAttendance for the user.
>>> print(sprint_attendance.is_physical)
True
- >>> time_starts = datetime.datetime(2005, 10, 8, 9, 0, 0, 0, UTC)
- >>> time_ends = datetime.datetime(2005, 10, 16, 19, 5, 0, 0, UTC)
+ >>> time_starts = datetime(2005, 10, 8, 9, 0, 0, 0, pytz.UTC)
+ >>> time_ends = datetime(2005, 10, 16, 19, 5, 0, 0, pytz.UTC)
>>> new_attendance = ubz.attend(person, time_starts, time_ends, False)
>>> print(new_attendance.attendee.name)
mustard
diff --git a/lib/lp/blueprints/stories/blueprints/xx-creation.txt b/lib/lp/blueprints/stories/blueprints/xx-creation.txt
index 35041a3..b17ca35 100644
--- a/lib/lp/blueprints/stories/blueprints/xx-creation.txt
+++ b/lib/lp/blueprints/stories/blueprints/xx-creation.txt
@@ -178,6 +178,18 @@ From a sprint
Starting from the Future Mega Meeting sprint page:
+ >>> from datetime import (
+ ... datetime,
+ ... timedelta,
+ ... )
+ >>> import pytz
+
+ >>> login('test@xxxxxxxxxxxxx')
+ >>> _ = factory.makeSprint(
+ ... name='futurista', title='Future Mega Meeting',
+ ... time_starts=datetime.now(pytz.UTC) + timedelta(days=1))
+ >>> logout()
+
>>> user_browser.open(
... 'http://blueprints.launchpad.test/sprints/futurista')
@@ -586,15 +598,13 @@ When registering a blueprint, users can specify the ''sprint'' field to
propose the blueprint as a topic for discussion at the sprint. If the user has
permission, the blueprint will be automatically added to the sprint agenda:
- >>> import datetime as dt
- >>> from pytz import UTC
>>> from lp.registry.interfaces.person import IPersonSet
>>> login('test@xxxxxxxxxxxxx')
>>> rome_sprint = factory.makeSprint(name='rome')
>>> logout()
>>> ignored = login_person(rome_sprint.owner)
- >>> rome_sprint.time_ends = dt.datetime.now(UTC) + dt.timedelta(30)
- >>> rome_sprint.time_starts = dt.datetime.now(UTC) + dt.timedelta(20)
+ >>> rome_sprint.time_ends = datetime.now(pytz.UTC) + timedelta(30)
+ >>> rome_sprint.time_starts = datetime.now(pytz.UTC) + timedelta(20)
>>> sample_person = getUtility(IPersonSet).getByName('name12')
>>> rome_sprint.driver = sample_person
>>> logout()
diff --git a/lib/lp/blueprints/stories/sprints/sprint-settopics.txt b/lib/lp/blueprints/stories/sprints/sprint-settopics.txt
index a0a0775..1d1e263 100644
--- a/lib/lp/blueprints/stories/sprints/sprint-settopics.txt
+++ b/lib/lp/blueprints/stories/sprints/sprint-settopics.txt
@@ -1,5 +1,18 @@
Any logged in user can propose specs to be discussed in a sprint.
+ >>> from datetime import (
+ ... datetime,
+ ... timedelta,
+ ... )
+ >>> import pytz
+
+ >>> login('test@xxxxxxxxxxxxx')
+ >>> _ = factory.makeSprint(
+ ... name='uds-guacamole', title='Ubuntu DevSummit Guacamole',
+ ... time_starts=datetime.now(pytz.UTC) + timedelta(days=1))
+ >>> transaction.commit()
+ >>> logout()
+
>>> user_browser.open(
... 'http://blueprints.launchpad.test/ubuntu/'
... '+spec/media-integrity-check/+linksprint')
diff --git a/lib/lp/blueprints/stories/standalone/sprint-links.txt b/lib/lp/blueprints/stories/standalone/sprint-links.txt
index 4f027f7..b133580 100644
--- a/lib/lp/blueprints/stories/standalone/sprint-links.txt
+++ b/lib/lp/blueprints/stories/standalone/sprint-links.txt
@@ -6,6 +6,18 @@ agenda, and then it is approved. If, however, the person nominating the spec
also has permission to approve it, then it should be approved automatically
for the agenda.
+ >>> from datetime import (
+ ... datetime,
+ ... timedelta,
+ ... )
+ >>> import pytz
+
+ >>> login('test@xxxxxxxxxxxxx')
+ >>> _ = factory.makeSprint(
+ ... name='uds-guacamole',
+ ... time_starts=datetime.now(pytz.UTC) + timedelta(days=1))
+ >>> logout()
+
First we open the page for the spec on Support <canvas> objects from the
sample data. We will use Sample Person, who has no special privileges.
diff --git a/lib/lp/registry/stories/object/xx-object-branding.txt b/lib/lp/registry/stories/object/xx-object-branding.txt
index 79c75f1..f4503cb 100644
--- a/lib/lp/registry/stories/object/xx-object-branding.txt
+++ b/lib/lp/registry/stories/object/xx-object-branding.txt
@@ -265,6 +265,10 @@ Sprint branding
Again, for Sprints, we have not exposed icon editing through the UI.
+ >>> login('test@xxxxxxxxxxxxx')
+ >>> _ = factory.makeSprint(name='futurista')
+ >>> logout()
+
>>> browser = setupBrowser(auth='Basic no-priv@xxxxxxxxxxxxx:test')
>>> browser.open('http://launchpad.test/sprints/futurista/+branding')
Traceback (most recent call last):
diff --git a/lib/lp/testing/factory.py b/lib/lp/testing/factory.py
index db48ed3..05b92c4 100644
--- a/lib/lp/testing/factory.py
+++ b/lib/lp/testing/factory.py
@@ -1087,15 +1087,16 @@ class BareLaunchpadObjectFactory(ObjectFactory):
removeSecurityProxy(project).driver = driver
return project
- def makeSprint(self, title=None, name=None):
+ def makeSprint(self, title=None, name=None, time_starts=None):
"""Make a sprint."""
if title is None:
title = self.getUniqueUnicode('title')
owner = self.makePerson()
if name is None:
name = self.getUniqueUnicode('name')
- time_starts = datetime(2009, 1, 1, tzinfo=pytz.UTC)
- time_ends = datetime(2009, 1, 2, tzinfo=pytz.UTC)
+ if time_starts is None:
+ time_starts = datetime(2009, 1, 1, tzinfo=pytz.UTC)
+ time_ends = time_starts + timedelta(days=1)
time_zone = u'UTC'
summary = self.getUniqueUnicode('summary')
return getUtility(ISprintSet).new(