janhoy commented on a change in pull request #497:
URL: https://github.com/apache/solr/pull/497#discussion_r784732629
##########
File path: dev-tools/scripts/smokeTestRelease.py
##########
@@ -1264,155 +1068,48 @@ def parse_config():
reVersion1 = re.compile(r'\>(\d+)\.(\d+)\.(\d+)(-alpha|-beta)?/\<',
re.IGNORECASE)
reVersion2 = re.compile(r'-(\d+)\.(\d+)\.(\d+)(-alpha|-beta)?\.',
re.IGNORECASE)
-def getAllLuceneReleases():
- s = load('https://archive.apache.org/dist/lucene/java')
-
- releases = set()
- for r in reVersion1, reVersion2:
- for tup in r.findall(s):
- if tup[-1].lower() == '-alpha':
- tup = tup[:3] + ('0',)
- elif tup[-1].lower() == '-beta':
- tup = tup[:3] + ('1',)
- elif tup[-1] == '':
- tup = tup[:3]
- else:
- raise RuntimeError('failed to parse version: %s' % tup[-1])
- releases.add(tuple(int(x) for x in tup))
-
- l = list(releases)
- l.sort()
- return l
-
-def confirmAllReleasesAreTestedForBackCompat(smokeVersion, unpackPath):
-
- print(' find all past Lucene releases...')
- allReleases = getAllLuceneReleases()
- #for tup in allReleases:
- # print(' %s' % '.'.join(str(x) for x in tup))
-
- testedIndices = set()
-
- os.chdir(unpackPath)
-
- print(' run TestBackwardsCompatibility..')
- command = 'ant test -Dtestcase=TestBackwardsCompatibility
-Dtests.verbose=true'
- p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
- stdout, stderr = p.communicate()
- if p.returncode != 0:
- # Not good: the test failed!
- raise RuntimeError('%s failed:\n%s' % (command, stdout))
- stdout = stdout.decode('utf-8',errors='replace').replace('\r\n','\n')
-
- if stderr is not None:
- # Should not happen since we redirected stderr to stdout:
- raise RuntimeError('stderr non-empty')
-
- reIndexName = re.compile(r'TEST: index[\s*=\s*](.*?)(-cfs|-nocfs)$',
re.MULTILINE)
- for name, cfsPart in reIndexName.findall(stdout):
- # Fragile: decode the inconsistent naming schemes we've used in TestBWC's
indices:
- #print('parse name %s' % name)
- tup = tuple(name.split('.'))
- if len(tup) == 3:
- # ok
- tup = tuple(int(x) for x in tup)
- elif tup == ('4', '0', '0', '1'):
- # CONFUSING: this is the 4.0.0-alpha index??
- tup = 4, 0, 0, 0
- elif tup == ('4', '0', '0', '2'):
- # CONFUSING: this is the 4.0.0-beta index??
- tup = 4, 0, 0, 1
- elif name == '5x-with-4x-segments':
- # Mixed version test case; ignore it for our purposes because we only
- # tally up the "tests single Lucene version" indices
- continue
- elif name == '5.0.0.singlesegment':
- tup = 5, 0, 0
- else:
- raise RuntimeError('could not parse version %s' % name)
-
- testedIndices.add(tup)
-
- l = list(testedIndices)
- l.sort()
- if False:
- for release in l:
- print(' %s' % '.'.join(str(x) for x in release))
-
- allReleases = set(allReleases)
-
- for x in testedIndices:
- if x not in allReleases:
- # Curious: we test 1.9.0 index but it's not in the releases (I think it
was pulled because of nasty bug?)
- if x != (1, 9, 0):
- raise RuntimeError('tested version=%s but it was not released?' %
'.'.join(str(y) for y in x))
-
- notTested = []
- for x in allReleases:
- if x not in testedIndices:
- releaseVersion = '.'.join(str(y) for y in x)
- if releaseVersion in ('1.4.3', '1.9.1', '2.3.1', '2.3.2'):
- # Exempt the dark ages indices
- continue
- if x >= tuple(int(y) for y in smokeVersion.split('.')):
- # Exempt versions not less than the one being smoke tested
- print(' Backcompat testing not required for release %s because
it\'s not less than %s'
- % (releaseVersion, smokeVersion))
- continue
- notTested.append(x)
-
- if len(notTested) > 0:
- notTested.sort()
- print('Releases that don\'t seem to be tested:')
- failed = True
- for x in notTested:
- print(' %s' % '.'.join(str(y) for y in x))
- raise RuntimeError('some releases are not tested by
TestBackwardsCompatibility?')
- else:
- print(' success!')
-
def main():
c = parse_config()
- scriptVersion = scriptutil.find_current_version()
+ # Pick <major>.<minor> part of version and require script to be from same
branch
+ scriptVersion = re.search(r'((\d+).(\d+)).(\d+)',
scriptutil.find_current_version()).group(1).strip()
if not c.version.startswith(scriptVersion + '.'):
raise RuntimeError('smokeTestRelease.py for %s.X is incompatible with a %s
release.' % (scriptVersion, c.version))
print('NOTE: output encoding is %s' % sys.stdout.encoding)
smokeTest(c.java, c.url, c.revision, c.version, c.tmp_dir, c.is_signed,
c.local_keys, ' '.join(c.test_args),
downloadOnly=c.download_only)
+
def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned,
local_keys, testArgs, downloadOnly=False):
startTime = datetime.datetime.now()
- # disable flakey tests for smoke-tester runs:
- testArgs = '-Dtests.badapples=false %s' % testArgs
-
+ # Tests annotated @Nightly are more resource-intensive but often cover
+ # important code paths. They're disabled by default to preserve a good
+ # developer experience, but we enable them for smoke tests where we want good
+ # coverage. Still we disable @BadApple tests
+ testArgs = '-Dtests.nigthly=true -Dtests.badapples=false %s' % testArgs
Review comment:
However, even if Lucene wants to run all nightly tests in smoke tester,
are we sure that Solr wants to? I fear that several `@Nightly` tests are
unstable, but I don't have too much facts to support it. They will for sure
take a loong time and need some resources. I believe that before November 2021
the smoke tester has ran without nightly tests. Guess we'll just have to try.
If they constantly fail or cause other issues, we can change it back to false.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]