(s, version, name, isHTML)
| 401 | def 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 | |
| 415 | reChangesSectionHREF = re.compile('<a id="(.*?)".*?>(.*?)</a>', re.IGNORECASE) |
| 416 | reUnderbarNotDashHTML = re.compile(r'<li>(\s*(SOLR)_\d\d\d\d+)') |
| 417 | reUnderbarNotDashTXT = re.compile(r'\s+((SOLR)_\d\d\d\d+)', re.MULTILINE) |
| 418 | |
| 419 | |
| 420 | def 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 |
no test coverage detected
searching dependent graphs…