bodhi/config/app.cfg | 4 ++++
bodhi/controllers.py | 29 +++++++++++++++--------------
bodhi/model.py | 2 +-
3 files changed, 20 insertions(+), 15 deletions(-)
New commits:
commit f599d577338f8f4fb09cda94ea8ea3b61d8dc54b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Mar 30 17:05:11 2011 -0400
Make our test case query optional
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg
index abadb42..6cd2684 100644
--- a/bodhi/config/app.cfg
+++ b/bodhi/config/app.cfg
@@ -18,6 +18,10 @@ newupdate_notice = ''
stablekarma_comment = 'This update has reached the stable karma threshold and will be
pushed to the stable updates repository'
+## Query the wiki for test cases
+query_wiki_test_cases = False
+wiki_url = 'https://fedoraproject.org/w/api.php'
+
##
## Mash settings
##
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index d6e98e9..bd33c66 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -965,20 +965,21 @@ class Root(controllers.RootController):
break
# Append links to unit tests in the update notes
- try:
- test_cases = []
- for build in update.builds:
- test_cases.extend(build.package.get_test_cases())
- # HACK: shove the unit tests into this PickleCol
- if test_cases:
- if not update.nagged:
- nagged = {}
- else:
- nagged = update.nagged
- nagged['test_cases'] = test_cases
- update.nagged = nagged
- except Exception, e:
- log.exception(e)
+ if config.get('query_wiki_test_cases'):
+ try:
+ test_cases = []
+ for build in update.builds:
+ test_cases.extend(build.package.get_test_cases())
+ # HACK: shove the unit tests into this PickleCol
+ if test_cases:
+ if not update.nagged:
+ nagged = {}
+ else:
+ nagged = update.nagged
+ nagged['test_cases'] = test_cases
+ update.nagged = nagged
+ except Exception, e:
+ log.exception(e)
# Send out mail notifications
if edited:
diff --git a/bodhi/model.py b/bodhi/model.py
index c019e0f..576b27f 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -181,7 +181,7 @@ class Package(SQLObject):
def get_test_cases(self):
""" Get a list of test cases from the wiki """
from simplemediawiki import MediaWiki
- wiki =
MediaWiki('https://fedoraproject.org/w/api.php')
+ wiki = MediaWiki(config.get('wiki_url',
'https://fedoraproject.org/w/api.php'))
cat_page = 'Category:Package %s test cases' % self.name
limit = 10