bodhi/buildsys.py | 3 +++
bodhi/tests/test_controllers.py | 26 +++++++++++++++-----------
bodhi/tests/test_model.py | 2 +-
3 files changed, 19 insertions(+), 12 deletions(-)
New commits:
commit bee8fbecfe47a0a92eefbb8e4efd16e901de2878
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 11 20:45:58 2009 -0400
Fix the TestControllers.test_broken_update_path_on_request unit test.
This broke when we recently stopped using a global singleton koji
session, which would timeout in production. This change now
monkeypatches the DevBuildsys class itself, instead of the instance
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 8c56d48..9ff1322 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -608,27 +608,31 @@ class TestControllers(testutil.DBTest):
self.save_update(params, session)
# Monkey-patch our DevBuildsys
- oldGetBuild = koji.getBuild
- koji.getBuild = lambda x: {'epoch': None, 'name':
'TurboGears',
- 'nvr': 'TurboGears-1.0.2.2-2.fc7',
- 'release': '2.fc7',
- 'tag_name':
'dist-fc7-updates-testing',
- 'version': '1.0.2.2'}
+ from bodhi.buildsys import DevBuildsys
+ oldGetBuild = DevBuildsys.getBuild
+ DevBuildsys.getBuild = lambda *x, **y: {
+ 'epoch': None, 'name': 'TurboGears',
+ 'nvr': 'TurboGears-1.0.2.2-2.fc7',
+ 'release': '2.fc7',
+ 'tag_name': 'dist-fc7-updates-testing',
+ 'version': '1.0.2.2'
+ }
# Make a newer build already exist
oldListTagged = koji.listTagged
- koji.listTagged = lambda *x, **y: [
+ DevBuildsys.listTagged = lambda *x, **y: [
{'epoch': None, 'name': 'TurboGears',
'nvr': 'TurboGears-1.0.2.3-2.fc7', 'release':
'2.fc7',
'tag_name': 'dist-fc7-updates-testing',
'version': '1.0.2.3'},
]
- testutil.capture_log('bodhi.util')
+ testutil.capture_log(['bodhi.util', 'bodhi.controllers',
'bodhi.model'])
testutil.create_request('/updates/request/stable/%s' %
params['builds'],
method='POST', headers=session)
- koji.getBuild = oldGetBuild
- koji.listTagged = oldListTagged
- assert 'Broken update path: TurboGears-1.0.2.3-2.fc7 is already released, and
is newer than TurboGears-1.0.2.2-2.fc7' in testutil.get_log()
+ DevBuildsys.getBuild = oldGetBuild
+ DevBuildsys.listTagged = oldListTagged
+ output = testutil.get_log()
+ assert 'Broken update path: TurboGears-1.0.2.3-2.fc7 is already released, and
is newer than TurboGears-1.0.2.2-2.fc7' in output, output
# Disabled for now, since we want to try and avoid as much bugzilla
# contact during our test cases as possible :)
commit 0d756996111a0752d573bbbaf98793f71644d4de
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 11 20:16:46 2009 -0400
Skip empty tasks in bodhi.buildsys.wait_for_tasks.
This fixes the broken test_edit_obsoletion test case
diff --git a/bodhi/buildsys.py b/bodhi/buildsys.py
index c8a6dd6..487af39 100644
--- a/bodhi/buildsys.py
+++ b/bodhi/buildsys.py
@@ -211,6 +211,9 @@ def wait_for_tasks(tasks, sleep=300):
log.debug("Waiting for %d tasks to complete: %s" % (len(tasks), tasks))
failed_tasks = []
for task in tasks:
+ if not task:
+ log.debug("Skipping task: %s" % task)
+ continue
while not session.taskFinished(task):
time.sleep(sleep)
task_info = session.getTaskInfo(task)
commit ff260dc14a2f61d9674b05c9606a99e821ab7696
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 11 17:22:51 2009 -0400
Minor test case tweak, for consistency purposes
diff --git a/bodhi/tests/test_model.py b/bodhi/tests/test_model.py
index 1affb95..de20041 100644
--- a/bodhi/tests/test_model.py
+++ b/bodhi/tests/test_model.py
@@ -118,7 +118,7 @@ class TestPackageUpdate(testutil.DBTest):
# Create another update for another release that has the same
# Release.id_prefix. This used to trigger a bug that would cause
# duplicate IDs across Fedora 10/11 updates.
- update = self.get_update(name='nethack-3.4.5-1.fc7')
+ update = self.get_update(name='nethack-3.4.5-1.fc11')
otherrel = Release(name='fc11', long_name='Fedora 11',
id_prefix='FEDORA', dist_tag='dist-fc11')
update.release = otherrel
Show replies by date