summaryrefslogtreecommitdiffstats
path: root/bin/check-missing-unittests.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/check-missing-unittests.py')
-rwxr-xr-xbin/check-missing-unittests.py64
1 files changed, 38 insertions, 26 deletions
diff --git a/bin/check-missing-unittests.py b/bin/check-missing-unittests.py
index d77936b6e202..0ee36ef76aaf 100755
--- a/bin/check-missing-unittests.py
+++ b/bin/check-missing-unittests.py
@@ -21,6 +21,19 @@ def splitList(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i + n]
+def whiteboardNotes(whiteboard):
+ if not whiteboard:
+ return ''
+ if ' ' in whiteboard:
+ whiteboardList = reversed(whiteboard.split(' '))
+ for w in whiteboardList:
+ if w.startswith("unitTestNotes"):
+ return w.split(':')[1]
+ elif whiteboard.startswith("unitTestNotes"):
+ return whiteboard.split(':')[1]
+
+ return ''
+
def main(ignoredBugs):
results = {
'export': {
@@ -138,7 +151,7 @@ def main(ignoredBugs):
# Keep the following if statements at the end
- elif 'sc/source/core/data/' in changedFiles:
+ elif 'sc/source/core/' in changedFiles:
results['calc']['others'][bugId] = infoList
elif 'sw/source/core/' in changedFiles:
@@ -154,7 +167,10 @@ def main(ignoredBugs):
if bugId not in hasTestSet:
listOfBugIdsWithoutTest.append(bugId)
+
bugzillaJson = []
+ resultList = []
+ fixList = []
#Split the list into different chunks for the requests, otherwise it fails
for chunk in splitList(listOfBugIdsWithoutTest, 50):
urlGet = 'https://bugs.documentfoundation.org/rest/bug?id=' + ','.join(chunk)
@@ -163,49 +179,45 @@ def main(ignoredBugs):
rGet.close()
bugzillaJson.extend(rawData['bugs'])
- print()
- print('{{TopMenu}}')
- print('{{Menu}}')
- print('{{Menu.Development}}')
- print()
- print('This report is generated by ' + os.path.basename(sys.argv[0]))
- print()
- print('Date: ' + str(datetime.datetime.now()))
- print()
- print('Commits: ' + str(len(commits)))
- print()
- print('Branch: ' + branch.decode().strip())
- print()
- print('Hash: ' + str(last_hash.decode().strip()))
-
for k,v in results.items():
- print('\n== ' + k + ' ==')
for k1, v1 in v.items():
- print('\n=== ' + k1 + ' ===')
for bugId, info in v1.items():
resolution = ''
keywords = []
priority = ''
+ notes = ''
for bug in bugzillaJson:
if str(bug['id']) == str(bugId):
resolution = bug['resolution']
keywords = bug['keywords']
priority = bug['priority']
+ notes = whiteboardNotes(bug['whiteboard'])
break
# Only care about FIXED bugs
# Ignore performance bugs and accessibility bugs
if resolution and resolution == 'FIXED' and 'perf' not in keywords \
and 'accessibility' not in keywords:
- print(
- "# {} - [{}] {} - [https://bugs.documentfoundation.org/show_bug.cgi?id={} tdf#{}]".format(
- info[0], priority.upper(), info[1], bugId, bugId))
-
- print('\n== ignored bugs ==')
- print(' '.join(ignoredBugs))
- print()
- print('[[Category:QA]][[Category:Development]]')
+ fixList.append({
+ "id": bugId,
+ "date": info[0],
+ "priority": priority.upper(),
+ "summary": info[1],
+ "maintopic":k,
+ "subtopic":k1,
+ "notes": notes
+ })
+
+ resultList.append([{
+ "Generator": os.path.basename(sys.argv[0]),
+ "Date": str(datetime.datetime.now()),
+ "Commits": str(len(commits)),
+ "Branch": branch.decode().strip(),
+ "Hash": str(last_hash.decode().strip()),
+ }])
+ resultList.append(fixList)
+ print(json.dumps(resultList))
def usage():
message = """usage: {program} [bugs to ignore (each one is one argument)]