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

Function verifySrcUnpacked

dev-tools/scripts/smokeTestRelease.py:604–644  ·  view source on GitHub ↗
(java, artifact, unpackPath, version, testArgs)

Source from the content-addressed store, hash-verified

602 raise RuntimeError('unpack produced entries %s; expected only %s' % (l, expected))
603
604 return '%s/%s' % (destDir, expected)
605
606SOLR_NOTICE = None
607SOLR_LICENSE = None
608
609def is_in_list(in_folder, files, indent=4):
610 for file_name in files:
611 print("%sChecking %s" % (" "*indent, file_name))
612 found = False
613 for f in [file_name, file_name + '.txt', file_name + '.md']:
614 if f in in_folder:
615 in_folder.remove(f)
616 found = True
617 if not found:
618 raise RuntimeError('file "%s" is missing' % file_name)
619
620
621def verifySrcUnpacked(java, artifact, unpackPath, version, testArgs):
622 # The source release is everything in source control minus excluded paths, so we don't
623 # check that it has specific things — the build will fail if something critical is missing.
624 # Also the binary release checks for presence of things that come from source control, so we're
625 # covered that way too.
626 os.chdir(unpackPath)
627 print(" %s" % artifact)
628
629 print(' make sure no JARs/WARs in src dist...')
630 lines = os.popen('find . -name \\*.jar').readlines()
631 if len(lines) != 0:
632 print(' FAILED:')
633 for line in lines:
634 print(' %s' % line.strip())
635 raise RuntimeError('source release has JARs...')
636 lines = os.popen('find . -name \\*.war').readlines()
637 if len(lines) != 0:
638 print(' FAILED:')
639 for line in lines:
640 print(' %s' % line.strip())
641 raise RuntimeError('source release has WARs...')
642
643 logDir = '%s/build' % unpackPath
644 os.makedirs(logDir, exist_ok=True)
645
646 validateCmd = './gradlew rat'
647 print(' run "%s"' % validateCmd)

Callers 1

smokeTestFunction · 0.85

Calls 3

_run_for_javaFunction · 0.85
testChangelogMdFunction · 0.85
stripMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…