You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2013/04/19 19:38:22 UTC
svn commit: r1469965 -
/lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py
Author: mikemccand
Date: Fri Apr 19 17:38:22 2013
New Revision: 1469965
URL: http://svn.apache.org/r1469965
Log:
LUCENE-4944: smoke tester detects duplicate sections in changes.html
Modified:
lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py
Modified: lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py?rev=1469965&r1=1469964&r2=1469965&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py (original)
+++ lucene/dev/branches/branch_4x/dev-tools/scripts/smokeTestRelease.py Fri Apr 19 17:38:22 2013
@@ -428,7 +428,9 @@ def testChangesText(dir, version, projec
fullPath = '%s/CHANGES.txt' % root
#print 'CHECK %s' % fullPath
checkChangesContent(open(fullPath, encoding='UTF-8').read(), version, fullPath, project, False)
-
+
+reChangesSectionHREF = re.compile('<a id="(.*?)".*?>(.*?)</a>', re.IGNORECASE)
+
def checkChangesContent(s, version, name, project, isHTML):
if isHTML and s.find('Release %s' % version) == -1:
@@ -448,6 +450,23 @@ def checkChangesContent(s, version, name
if name.find('/benchmark/') == -1:
raise RuntimeError('did not see "%s" in %s' % (sub, name))
+ if isHTML:
+ # Make sure a section only appears once under each release:
+ seenIDs = set()
+ seenText = set()
+
+ release = None
+ for id, text in reChangesSectionHREF.findall(s):
+ if text.lower().startswith('release '):
+ release = text[8:].strip()
+ seenText.clear()
+ if id in seenIDs:
+ raise RuntimeError('%s has duplicate section "%s" under release "%s"' % (name, text, release))
+ seenIDs.add(id)
+ if text in seenText:
+ raise RuntimeError('%s has duplicate section "%s" under release "%s"' % (name, text, release))
+ seenText.add(text)
+
reUnixPath = re.compile(r'\b[a-zA-Z_]+=(?:"(?:\\"|[^"])*"' + '|(?:\\\\.|[^"\'\\s])*' + r"|'(?:\\'|[^'])*')" \
+ r'|(/(?:\\.|[^"\'\s])*)' \
+ r'|("/(?:\\.|[^"])*")' \