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

Function smokeTest

dev-tools/scripts/smokeTestRelease.py:1104–1171  ·  view source on GitHub ↗
(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys, testArgs, downloadOnly=False)

Source from the content-addressed store, hash-verified

1102 cmd.append(testArgs)
1103 print()
1104 print('NOTE: to re-run (e.g. with a different Java version) reusing what is already downloaded to %s:' % tmpDir)
1105 print(' JAVA_HOME=/path/to/java %s' % ' '.join(cmd))
1106
1107
1108def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys, testArgs, downloadOnly=False):
1109 startTime = datetime.datetime.now()
1110 origTestArgs = testArgs
1111
1112 # Avoid @Nightly and @Badapple tests as they are slow and buggy
1113 # Instead verify that the recent Jenkins tests pass
1114 print('NOTE: Not running @Nightly or @BadApple tests. Please verify that recent Jenkins runs have passed.')
1115 testArgs = '-Dtests.nightly=false -Dtests.badapples=false %s' % testArgs
1116
1117 if FORCE_CLEAN:
1118 if os.path.exists(tmpDir):
1119 raise RuntimeError('temp dir %s exists; please remove first' % tmpDir)
1120
1121 if not os.path.exists(tmpDir):
1122 os.makedirs(tmpDir)
1123
1124 printReuseHint(baseURL, gitRevision, version, tmpDir, isSigned, local_keys, origTestArgs)
1125
1126 solrPath = None
1127 print()
1128 print('Load release URL "%s"...' % baseURL)
1129 newBaseURL = unshortenURL(baseURL)
1130 if newBaseURL != baseURL:
1131 print(' unshortened: %s' % newBaseURL)
1132 baseURL = newBaseURL
1133
1134 if baseURL.endswith('distribution/build/release'):
1135 # Used when building release locally in Jenkins
1136 solrPath = baseURL
1137 else:
1138 # An ordinary release has a 'solr' sub folder
1139 for text, subURL in getDirEntries(baseURL):
1140 if text.lower() == "solr/":
1141 solrPath = subURL
1142 for text, subURL in getDirEntries(solrPath):
1143 if text.lower() == version + "/":
1144 solrPath = subURL
1145
1146 if solrPath is None:
1147 raise RuntimeError("could not find solr/%s/ subdir" % version)
1148
1149 keysFile = None
1150 if isSigned or local_keys is not None:
1151 print()
1152 print('Get KEYS...')
1153 if local_keys is not None:
1154 print(" Using local KEYS file %s" % local_keys)
1155 keysFile = local_keys
1156 else:
1157 keysFileURL = "https://archive.apache.org/dist/solr/KEYS"
1158 print(" Downloading online KEYS file %s" % keysFileURL)
1159 scriptutil.download('KEYS', keysFileURL, tmpDir, force_clean=FORCE_CLEAN)
1160 keysFile = '%s/KEYS' % (tmpDir)
1161

Callers 1

mainFunction · 0.85

Calls 9

unshortenURLFunction · 0.85
getDirEntriesFunction · 0.85
checkSigsFunction · 0.85
verifyBinaryUnpackedFunction · 0.85
unpackFunction · 0.85
verifySrcUnpackedFunction · 0.85
checkMavenFunction · 0.85
existsMethod · 0.65
downloadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…