MCPcopy Create free account
hub / github.com/apache/solr / checkChangesContent

Function checkChangesContent

dev-tools/scripts/smokeTestRelease.py:403–447  ·  view source on GitHub ↗
(s, version, name, isHTML)

Source from the content-addressed store, hash-verified

401def testChangelogMd(dir, version):
402 "Checks CHANGELOG.md file."
403 changelog_path = os.path.join(dir, 'CHANGELOG.md')
404
405 if not os.path.exists(changelog_path):
406 raise RuntimeError('CHANGELOG.md not found at %s' % changelog_path)
407
408 with open(changelog_path, encoding='UTF-8') as f:
409 content = f.read()
410
411 # Verify that the changelog contains the current version
412 if 'SNAPSHOT' not in version and 'v%s' % version not in content and version not in content:
413 raise RuntimeError('Version %s not found in CHANGELOG.md' % version)
414
415reChangesSectionHREF = re.compile('<a id="(.*?)".*?>(.*?)</a>', re.IGNORECASE)
416reUnderbarNotDashHTML = re.compile(r'<li>(\s*(SOLR)_\d\d\d\d+)')
417reUnderbarNotDashTXT = re.compile(r'\s+((SOLR)_\d\d\d\d+)', re.MULTILINE)
418
419
420def checkChangesContent(s, version, name, isHTML):
421 currentVersionTuple = versionToTuple(version, name)
422
423 if isHTML and 'SNAPSHOT' not in version and s.find('Release %s' % version) == -1:
424 raise RuntimeError('did not see "Release %s" in %s' % (version, name))
425
426 if isHTML:
427 r = reUnderbarNotDashHTML
428 else:
429 r = reUnderbarNotDashTXT
430
431 m = r.search(s)
432 if m is not None:
433 raise RuntimeError('incorrect issue (_ instead of -) in %s: %s' % (name, m.group(1)))
434
435 if s.lower().find('not yet released') != -1:
436 raise RuntimeError('saw "not yet released" in %s' % name)
437
438 if not isHTML:
439 sub = version
440 if s.find(sub) == -1:
441 # benchmark never seems to include release info:
442 if name.find('/benchmark/') == -1:
443 raise RuntimeError('did not see "%s" in %s' % (sub, name))
444
445 if isHTML:
446 # Make sure that a section only appears once under each release,
447 # and that each release is not greater than the current version
448 seenIDs = set()
449 seenText = set()
450

Callers 1

testChangesFunction · 0.85

Calls 7

versionToTupleFunction · 0.85
stripMethod · 0.80
clearMethod · 0.65
addMethod · 0.65
setFunction · 0.50
findMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…