Fix new skipping logic in yaml tests
This commit is contained in:
@@ -30,6 +30,8 @@ def get_test_client(nowait=False):
|
|||||||
raise SkipTest("Elasticsearch failed to start.")
|
raise SkipTest("Elasticsearch failed to start.")
|
||||||
|
|
||||||
def _get_version(version_string):
|
def _get_version(version_string):
|
||||||
|
if '.' not in version_string:
|
||||||
|
return ()
|
||||||
version = version_string.strip().split('.')
|
version = version_string.strip().split('.')
|
||||||
return tuple(int(v) if v.isdigit() else 999 for v in version)
|
return tuple(int(v) if v.isdigit() else 999 for v in version)
|
||||||
|
|
||||||
|
|||||||
@@ -152,8 +152,8 @@ class YamlTestCase(ElasticsearchTestCase):
|
|||||||
if 'version' in skip:
|
if 'version' in skip:
|
||||||
version, reason = skip['version'], skip['reason']
|
version, reason = skip['version'], skip['reason']
|
||||||
min_version, max_version = version.split('-')
|
min_version, max_version = version.split('-')
|
||||||
min_version = _get_version(min_version)
|
min_version = _get_version(min_version) or (0, )
|
||||||
max_version = _get_version(max_version)
|
max_version = _get_version(max_version) or (999, )
|
||||||
if min_version <= self.es_version <= max_version:
|
if min_version <= self.es_version <= max_version:
|
||||||
raise SkipTest(reason)
|
raise SkipTest(reason)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user