mirror of https://github.com/apache/lucene.git
LUCENE-4944: smoke tester detects duplicate sections in changes.html
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1469966 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
07b0e1cae7
commit
452c1d4683
|
@ -420,7 +420,9 @@ def testChangesText(dir, version, project):
|
|||
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:
|
||||
|
@ -440,6 +442,23 @@ def checkChangesContent(s, version, name, project, isHTML):
|
|||
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'|("/(?:\\.|[^"])*")' \
|
||||
|
|
Loading…
Reference in New Issue