summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@digia.com>2013-04-22 13:52:53 +0200
committerChristian Stenger <christian.stenger@digia.com>2013-04-23 17:04:07 +0200
commiteab228dcca8b52e2a178aadcd74b8139b91cb567 (patch)
treed3e49650391db29f963212300d85b7219cfe51a8 /tests
parent59edc405939307606551fd96895dc767fb6a5d23 (diff)
downloadqt-creator-eab228dcca8b52e2a178aadcd74b8139b91cb567.tar.gz
Squish: Cleanup workarounds.py
* removed fetching status * improved output for closed bugs Change-Id: Ice0256f75571c6c44e9878447d3821247f5ded4f Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/system/shared/workarounds.py26
1 files changed, 8 insertions, 18 deletions
diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py
index f0ce4c348c..b47c9aad55 100644
--- a/tests/system/shared/workarounds.py
+++ b/tests/system/shared/workarounds.py
@@ -22,7 +22,7 @@ class JIRA:
else:
JIRA.__instance__._bugType = bugType
JIRA.__instance__._number = number
- JIRA.__instance__.__fetchStatusAndResolutionFromJira__()
+ JIRA.__instance__.__fetchResolutionFromJira__()
# overriden to make it possible to use JIRA just like the
# underlying implementation (__impl)
@@ -56,7 +56,7 @@ class JIRA:
if JIRA.isBugStillOpen(number, bugType):
return JIRA.performWorkaroundForBug(number, bugType, *args)
else:
- test.warning("Bug is closed... skipping workaround!",
+ test.warning("Bug %s-%d is closed... skipping workaround!" % (bugType, number),
"You should remove potential code inside performWorkaroundForBug()")
return False
@@ -82,7 +82,7 @@ class JIRA:
self._localOnly = os.getenv("SYSTEST_JIRA_NO_LOOKUP")=="1"
self.__initBugDict__()
self._fetchResults_ = {}
- self.__fetchStatusAndResolutionFromJira__()
+ self.__fetchResolutionFromJira__()
# this function checks the resolution of the given bug
# and returns True if the bug can still be assumed as 'Open' and False otherwise
@@ -96,16 +96,15 @@ class JIRA:
return True
return self._resolution != 'Done'
- # this function tries to fetch the status and resolution from JIRA for the given bug
+ # this function tries to fetch the resolution from JIRA for the given bug
# if this isn't possible or the lookup is disabled it does only check the internal
# dict whether a function for the given bug is deposited or not
- def __fetchStatusAndResolutionFromJira__(self):
+ def __fetchResolutionFromJira__(self):
global JIRA_URL
bug = "%s-%d" % (self._bugType, self._number)
if bug in self._fetchResults_:
result = self._fetchResults_[bug]
- self._resolution = result[0]
- self._status = result[1]
+ self._resolution = result
return
data = None
proxy = os.getenv("SYSTEST_PROXY", None)
@@ -129,7 +128,6 @@ class JIRA:
if bug in self.__bugs__:
test.warning("Using internal dict - bug status could have changed already",
"Please check manually!")
- self._status = None
self._resolution = None
else:
test.fatal("No workaround function deposited for %s" % bug)
@@ -137,24 +135,16 @@ class JIRA:
else:
data = data.replace("\r", "").replace("\n", "")
resPattern = re.compile('<span\s+id="resolution-val".*?>(?P<resolution>.*?)</span>')
- statPattern = re.compile('<span\s+id="status-val".*?>(.*?<img.*?>)?(?P<status>.*?)</span>')
- status = statPattern.search(data)
resolution = resPattern.search(data)
- if status:
- self._status = status.group("status").strip()
- else:
- test.fatal("FATAL: Cannot get status of bugreport %s" % bug,
- "Looks like JIRA has changed.... Please verify!")
- self._status = None
if resolution:
self._resolution = resolution.group("resolution").strip()
else:
test.fatal("FATAL: Cannot get resolution of bugreport %s" % bug,
"Looks like JIRA has changed.... Please verify!")
self._resolution = None
- if None in (self._status, self._resolution):
+ if self._resolution == None:
self.__cropAndLog__(data)
- self._fetchResults_.update({bug:[self._resolution, self._status]})
+ self._fetchResults_.update({bug:self._resolution})
# simple helper function - used as fallback if python has no ssl support
# tries to find curl or wget in PATH and fetches data with it instead of