mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot: fix time ralated failing test
Some test where failing since _find_new_commits will skip commit older than max_age
This commit is contained in:
parent
bdc6506ede
commit
55c4e49ada
@ -6,6 +6,8 @@ import logging
|
|||||||
import odoo
|
import odoo
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -56,7 +58,7 @@ class Test_Repo(common.TransactionCase):
|
|||||||
|
|
||||||
self.commit_list = [('refs/heads/bidon',
|
self.commit_list = [('refs/heads/bidon',
|
||||||
'd0d0caca',
|
'd0d0caca',
|
||||||
'2019-04-29 13:03:17 +0200',
|
datetime.datetime.now().strftime("%Y-%m-%d, %H:%M:%S"),
|
||||||
'Marc Bidule',
|
'Marc Bidule',
|
||||||
'<marc.bidule@somewhere.com>',
|
'<marc.bidule@somewhere.com>',
|
||||||
'A nice subject',
|
'A nice subject',
|
||||||
@ -71,6 +73,7 @@ class Test_Repo(common.TransactionCase):
|
|||||||
self.assertEqual(branch.name, 'refs/heads/bidon', 'A new branch should have been created')
|
self.assertEqual(branch.name, 'refs/heads/bidon', 'A new branch should have been created')
|
||||||
|
|
||||||
build = self.env['runbot.build'].search([('repo_id', '=', repo.id), ('branch_id', '=', branch.id)])
|
build = self.env['runbot.build'].search([('repo_id', '=', repo.id), ('branch_id', '=', branch.id)])
|
||||||
|
self.assertEqual(len(build), 1, 'Build found')
|
||||||
self.assertEqual(build.subject, 'A nice subject')
|
self.assertEqual(build.subject, 'A nice subject')
|
||||||
self.assertEqual(build.local_state, 'pending')
|
self.assertEqual(build.local_state, 'pending')
|
||||||
self.assertFalse(build.local_result)
|
self.assertFalse(build.local_result)
|
||||||
@ -78,7 +81,7 @@ class Test_Repo(common.TransactionCase):
|
|||||||
# Simulate that a new commit is found in the other repo
|
# Simulate that a new commit is found in the other repo
|
||||||
self.commit_list = [('refs/heads/bidon',
|
self.commit_list = [('refs/heads/bidon',
|
||||||
'deadbeef',
|
'deadbeef',
|
||||||
'2019-04-29 13:05:30 +0200',
|
datetime.datetime.now().strftime("%Y-%m-%d, %H:%M:%S"),
|
||||||
'Marc Bidule',
|
'Marc Bidule',
|
||||||
'<marc.bidule@somewhere.com>',
|
'<marc.bidule@somewhere.com>',
|
||||||
'A better subject',
|
'A better subject',
|
||||||
@ -99,7 +102,7 @@ class Test_Repo(common.TransactionCase):
|
|||||||
# A new commit is found in the first repo, the previous pending build should be skipped
|
# A new commit is found in the first repo, the previous pending build should be skipped
|
||||||
self.commit_list = [('refs/heads/bidon',
|
self.commit_list = [('refs/heads/bidon',
|
||||||
'b00b',
|
'b00b',
|
||||||
'2019-04-29 13:07:30 +0200',
|
datetime.datetime.now().strftime("%Y-%m-%d, %H:%M:%S"),
|
||||||
'Marc Bidule',
|
'Marc Bidule',
|
||||||
'<marc.bidule@somewhere.com>',
|
'<marc.bidule@somewhere.com>',
|
||||||
'Another subject',
|
'Another subject',
|
||||||
@ -136,7 +139,7 @@ class Test_Repo(common.TransactionCase):
|
|||||||
for i in range(20005):
|
for i in range(20005):
|
||||||
self.commit_list.append(['refs/heads/bidon-%05d' % i,
|
self.commit_list.append(['refs/heads/bidon-%05d' % i,
|
||||||
'd0d0caca %s' % i,
|
'd0d0caca %s' % i,
|
||||||
'2019-04-29 13:03:17 +0200',
|
datetime.datetime.now().strftime("%Y-%m-%d, %H:%M:%S"),
|
||||||
'Marc Bidule',
|
'Marc Bidule',
|
||||||
'<marc.bidule@somewhere.com>',
|
'<marc.bidule@somewhere.com>',
|
||||||
'A nice subject',
|
'A nice subject',
|
||||||
|
Loading…
Reference in New Issue
Block a user