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

Function parse_config

dev-tools/scripts/smokeTestRelease.py:1025–1085  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1023 parser.add_argument('--not-signed', dest='is_signed', action='store_false', default=True,
1024 help='Indicates the release is not signed')
1025 parser.add_argument('--local-keys', metavar='PATH',
1026 help='Uses local KEYS file instead of fetching from https://archive.apache.org/dist/solr/KEYS')
1027 parser.add_argument('--revision',
1028 help='GIT revision number that release was built with, defaults to that in URL')
1029 parser.add_argument('--version', metavar='X.Y.Z(-ALPHA|-BETA)?',
1030 help='Version of the release, defaults to that in URL')
1031 parser.add_argument('--download-only', action='store_true', default=False,
1032 help='Only perform download and sha hash check steps')
1033 parser.add_argument('--dev-mode', action='store_true', default=False,
1034 help='Enable dev mode, will not check branch compatibility')
1035 parser.add_argument('url', help='Url pointing to release to test')
1036 parser.add_argument('test_args', nargs=argparse.REMAINDER,
1037 help='Arguments to pass to gradle for testing, e.g. -Dwhat=ever.')
1038 c = parser.parse_args()
1039
1040 if c.version is not None:
1041 if not version_re.match(c.version):
1042 parser.error('version "%s" does not match format X.Y.Z[-ALPHA|-BETA]' % c.version)
1043 else:
1044 version_match = version_re.search(c.url)
1045 if version_match is None:
1046 parser.error('Could not find version in URL')
1047 c.version = version_match.group(1)
1048
1049 if c.revision is None:
1050 revision_match = revision_re.search(c.url)
1051 if revision_match is None:
1052 parser.error('Could not find revision in URL')
1053 c.revision = revision_match.group(1)
1054 print('Revision: %s' % c.revision)
1055
1056 if c.local_keys is not None and not os.path.exists(c.local_keys):
1057 parser.error('Local KEYS file "%s" not found' % c.local_keys)
1058
1059 c.java = make_java_config(parser)
1060
1061 if c.tmp_dir:
1062 c.tmp_dir = os.path.abspath(c.tmp_dir)
1063 else:
1064 tmp = '/tmp/smoke_solr_%s_%s' % (c.version, c.revision)
1065 c.tmp_dir = tmp
1066 i = 1
1067 while os.path.exists(c.tmp_dir):
1068 c.tmp_dir = tmp + '_%d' % i
1069 i += 1
1070
1071 return c
1072
1073reVersion1 = re.compile(r'\>(\d+)\.(\d+)\.(\d+)(-alpha|-beta)?/\<', re.IGNORECASE)
1074reVersion2 = re.compile(r'-(\d+)\.(\d+)\.(\d+)(-alpha|-beta)?\.', re.IGNORECASE)
1075
1076
1077def main():
1078 c = parse_config()
1079
1080 # Pick <major>.<minor> part of version and require script to be from same branch
1081 scriptVersion = re.search(r'((\d+).(\d+)).(\d+)', scriptutil.find_current_version()).group(1).strip()
1082 if not c.version.startswith(scriptVersion + '.') and not c.dev_mode:

Callers 1

mainFunction · 0.70

Calls 5

make_java_configFunction · 0.85
existsMethod · 0.65
matchMethod · 0.45
errorMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…