I think this now passes all its tests, but I'm being bitten by bug 871596 so I'm not sure. I'll try it on ec2.
I don't understand the comment on this test: specifically how it is checking jobs that have been waiting for a long period of time:
def test_run_branches_not_ready(self):
# If the job has been waiting for a significant period of time (15
# minutes for now), we run the job anyway. The checkReady method
# then raises and this is caught as a user error by the job system,
# and as such sends an email to the error recipients, which for this
# job is the merge proposal registrant.
eric = self.factory.makePerson(name='eric', <email address hidden>')
bmp = self.factory.makeBranchMergeProposal(registrant=eric)
job = UpdatePreviewDiffJob.create(bmp) pop_notifications() JobRunner([job]).runAll()
[email] = pop_notifications() self.assertEqual('Eric <email address hidden>', email['to']) self.assertEqual( 'Launchpad error while generating the diff for a merge proposal', email['subject']) self.assertEqual( 'Launchpad encountered an error during the following operation: ' 'generating the diff for a merge proposal. '
'The source branch has no revisions.', email.get_payload(decode=True))
I think this now passes all its tests, but I'm being bitten by bug 871596 so I'm not sure. I'll try it on ec2.
I don't understand the comment on this test: specifically how it is checking jobs that have been waiting for a long period of time:
def test_run_ branches_ not_ready( self): makePerson( name='eric' , <email address hidden>') makeBranchMerge Proposal( registrant= eric) ffJob.create( bmp)
pop_notificati ons()
JobRunner( [job]). runAll( )
self.assertEqu al('Eric <email address hidden>', email['to'])
self.assertEqu al(
'Launchpad error while generating the diff for a merge proposal',
email[ 'subject' ])
self.assertEqu al(
'Launchpad encountered an error during the following operation: '
'generatin g the diff for a merge proposal. '
email. get_payload( decode= True))
# If the job has been waiting for a significant period of time (15
# minutes for now), we run the job anyway. The checkReady method
# then raises and this is caught as a user error by the job system,
# and as such sends an email to the error recipients, which for this
# job is the merge proposal registrant.
eric = self.factory.
bmp = self.factory.
job = UpdatePreviewDi
[email] = pop_notifications()
'The source branch has no revisions.',