Skip to content

Commit

Permalink
Update tested versions of Elasticsearch (elastic#1570)
Browse files Browse the repository at this point in the history
This should help reduce testing load.

Release prep update of Changelog

Let's get this thing out.

Update docs and failing tests

Some tests had some new 7.10 allocation (tier specifics) that needed to be caught.
  • Loading branch information
untergeek authored Nov 24, 2020
1 parent 99bb6d4 commit 1f182f2
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 58 deletions.
18 changes: 6 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,16 @@ python:

env:
- ES_VERSION=5.6.16
- ES_VERSION=6.0.1
- ES_VERSION=6.1.3
- ES_VERSION=6.2.4
- ES_VERSION=6.3.2
- ES_VERSION=6.4.3
- ES_VERSION=6.5.4
- ES_VERSION=6.6.2
- ES_VERSION=6.7.2
- ES_VERSION=6.8.2
- ES_VERSION=7.0.0-linux-x86_64
- ES_VERSION=7.1.1-linux-x86_64
- ES_VERSION=6.8.13
- ES_VERSION=7.2.1-linux-x86_64
- ES_VERSION=7.3.1-linux-x86_64
- ES_VERSION=7.4.2-linux-x86_64
- ES_VERSION=7.5.2-linux-x86_64
- ES_VERSION=7.6.1-linux-x86_64
- ES_VERSION=7.6.2-linux-x86_64
- ES_VERSION=7.7.1-linux-x86_64
- ES_VERSION=7.8.1-linux-x86_64
- ES_VERSION=7.9.3-linux-x86_64
- ES_VERSION=7.10.0-linux-x86_64

os: linux

Expand Down
16 changes: 14 additions & 2 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
Changelog
=========

5.8.2 (? ? ?)
-------------
5.8.2 (24 November 2020)
------------------------

**Announcement**

* No, Curator isn't going away. But as you can tell, it's not as actively
developed as it once was. I am gratified to find there are still users who
make it a part of their workflow. I intend to continue development in my
spare time. Curator is now a labor of love, not an engineering project I
do during work hours.

**New**

* Testing changes. Only last ES version of 5.x and 6.x are tested, plus the
releases of 7.x since 7.2.
* ``http_auth`` is now deprecated. You can continue to use it, but it will go
away in the next major release. Moving forward, you should use ``username``
and ``password``. This should work in ``curator``, ``curator_cli``, and
Expand All @@ -30,6 +40,8 @@ Changelog
* Fix ``client.tasks.get`` API call to be ``client.tasks.list`` when no index
name is provided. See
https://github.com/elastic/elasticsearch-py/issues/1110
* Pin some pip versions to allow urllib3 and boto to coexist. See #1562
(sethmlarson).

**Documentation**

Expand Down
6 changes: 3 additions & 3 deletions docs/asciidoc/index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
:curator_version: 5.8.2
:curator_major: 5
:curator_doc_tree: 5.8
:es_py_version: 7.0.4
:es_doc_tree: 7.3
:stack_doc_tree: 7.3
:es_py_version: 7.1.0
:es_doc_tree: 7.10
:stack_doc_tree: 7.10
:pybuild_ver: 3.7.4
:ref: http://www.elastic.co/guide/en/elasticsearch/reference/{es_doc_tree}
:esref: http://www.elastic.co/guide/en/elasticsearch/reference/{stack_doc_tree}
Expand Down
110 changes: 92 additions & 18 deletions test/integration/test_allocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
host, port = os.environ.get('TEST_ES_SERVER', 'localhost:9200').split(':')
port = int(port) if port else 9200

EMPTY710ROUTING = {'allocation': {'include': {'_tier_preference': 'data_content'}}}


class TestActionFileAllocation(CuratorTestCase):
def test_include(self):
key = 'tag'
value = 'value'
at = 'include'
ver = curator.get_version(self.client)
self.write_config(
self.args['configfile'], testvars.client_config.format(host, port))
self.write_config(self.args['actionfile'],
Expand All @@ -38,12 +41,21 @@ def test_include(self):
)
self.assertEquals(value,
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index']['routing']['allocation'][at][key])
self.assertNotIn('routing',
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index'])
if ver >= (7, 10, 0):
self.assertEquals(
EMPTY710ROUTING,
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index']['routing']
)
else:
self.assertNotIn('routing',
self.client.indices.get_settings(
index='not_my_index')['not_my_index']['settings']['index']
)
def test_require(self):
key = 'tag'
value = 'value'
at = 'require'
ver = curator.get_version(self.client)
self.write_config(
self.args['configfile'], testvars.client_config.format(host, port))
self.write_config(self.args['actionfile'],
Expand All @@ -60,12 +72,21 @@ def test_require(self):
)
self.assertEquals(value,
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index']['routing']['allocation'][at][key])
self.assertNotIn('routing',
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index'])
if ver >= (7, 10, 0):
self.assertEquals(
EMPTY710ROUTING,
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index']['routing']
)
else:
self.assertNotIn('routing',
self.client.indices.get_settings(
index='not_my_index')['not_my_index']['settings']['index']
)
def test_exclude(self):
key = 'tag'
value = 'value'
at = 'exclude'
ver = curator.get_version(self.client)
self.write_config(
self.args['configfile'], testvars.client_config.format(host, port))
self.write_config(self.args['actionfile'],
Expand All @@ -82,12 +103,21 @@ def test_exclude(self):
)
self.assertEquals(value,
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index']['routing']['allocation'][at][key])
self.assertNotIn('routing',
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index'])
if ver >= (7, 10, 0):
self.assertEquals(
EMPTY710ROUTING,
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index']['routing']
)
else:
self.assertNotIn('routing',
self.client.indices.get_settings(
index='not_my_index')['not_my_index']['settings']['index']
)
def test_remove_exclude_with_none_value(self):
key = 'tag'
value = ''
at = 'exclude'
ver = curator.get_version(self.client)
self.write_config(
self.args['configfile'], testvars.client_config.format(host, port))
self.write_config(self.args['actionfile'],
Expand All @@ -110,10 +140,23 @@ def test_remove_exclude_with_none_value(self):
self.args['actionfile']
],
)
self.assertNotIn('routing',
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index'])
if ver >= (7, 10, 0):
self.assertEquals(
EMPTY710ROUTING,
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index']['routing']
)
self.assertEquals(
EMPTY710ROUTING,
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index']['routing']
)
else:
self.assertNotIn('routing',
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(
index='not_my_index')['not_my_index']['settings']['index']
)

def test_invalid_allocation_type(self):
key = 'tag'
value = 'value'
Expand Down Expand Up @@ -153,6 +196,7 @@ def test_skip_closed(self):
key = 'tag'
value = 'value'
at = 'include'
ver = curator.get_version(self.client)
self.write_config(
self.args['configfile'], testvars.client_config.format(host, port))
self.write_config(self.args['actionfile'],
Expand All @@ -168,14 +212,27 @@ def test_skip_closed(self):
self.args['actionfile']
],
)
self.assertNotIn('routing',
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index'])
if ver >= (7, 10, 0):
self.assertEquals(
EMPTY710ROUTING,
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index']['routing']
)
self.assertEquals(
EMPTY710ROUTING,
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index']['routing']
)
else:
self.assertNotIn('routing',
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(
index='not_my_index')['not_my_index']['settings']['index']
)
def test_wait_for_completion(self):
key = 'tag'
value = 'value'
at = 'require'
ver = curator.get_version(self.client)
self.write_config(
self.args['configfile'], testvars.client_config.format(host, port))
self.write_config(self.args['actionfile'],
Expand All @@ -192,14 +249,23 @@ def test_wait_for_completion(self):
)
self.assertEquals(value,
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index']['routing']['allocation'][at][key])
self.assertNotIn('routing',
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index'])
if ver >= (7, 10, 0):
self.assertEquals(
EMPTY710ROUTING,
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index']['routing']
)
else:
self.assertNotIn('routing',
self.client.indices.get_settings(
index='not_my_index')['not_my_index']['settings']['index']
)

class TestCLIAllocation(CuratorTestCase):
def test_include(self):
key = 'tag'
value = 'value'
at = 'include'
ver = curator.get_version(self.client)
self.create_index('my_index')
self.create_index('not_my_index')
args = self.get_runner_args()
Expand All @@ -215,5 +281,13 @@ def test_include(self):
self.assertEqual(0, self.run_subprocess(args, logname='TestCLIAllocation.test_include'))
self.assertEquals(value,
self.client.indices.get_settings(index='my_index')['my_index']['settings']['index']['routing']['allocation'][at][key])
self.assertNotIn('routing',
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index'])
if ver >= (7, 10, 0):
self.assertEquals(
EMPTY710ROUTING,
self.client.indices.get_settings(index='not_my_index')['not_my_index']['settings']['index']['routing']
)
else:
self.assertNotIn('routing',
self.client.indices.get_settings(
index='not_my_index')['not_my_index']['settings']['index']
)
46 changes: 23 additions & 23 deletions test/integration/test_count_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

global_client = elasticsearch.Elasticsearch(host=host, port=port)

EMPTY710ROUTING = {'allocation': {'include': {'_tier_preference': 'data_content'}}}

delete_count_pattern = ('---\n'
'actions:\n'
' 1:\n'
Expand Down Expand Up @@ -53,7 +55,7 @@ def test_match_proper_indices(self):
)
)
test = clicktest.CliRunner()
result = test.invoke(
_ = test.invoke(
curator.cli,
[
'--config', self.args['configfile'],
Expand All @@ -79,7 +81,7 @@ def test_match_proper_indices_by_age(self):
)
)
test = clicktest.CliRunner()
result = test.invoke(
_ = test.invoke(
curator.cli,
[
'--config', self.args['configfile'],
Expand All @@ -92,6 +94,7 @@ def test_count_indices_by_age_same_age(self):
key = 'tag'
value = 'value'
at = 'include'
ver = curator.get_version(self.client)
self.write_config(
self.args['configfile'], testvars.client_config.format(host, port))
self.write_config(self.args['actionfile'],
Expand All @@ -109,7 +112,7 @@ def test_count_indices_by_age_same_age(self):
self.create_index('d-2017.10.02')
self.create_index('d-2017.10.03')
test = clicktest.CliRunner()
result = test.invoke(
_ = test.invoke(
curator.cli,
[
'--config', self.args['configfile'],
Expand All @@ -120,23 +123,20 @@ def test_count_indices_by_age_same_age(self):
self.client.indices.get_settings(index='c-2017.10.03')['c-2017.10.03']['settings']['index']['routing']['allocation'][at][key])
self.assertEquals(value,
self.client.indices.get_settings(index='d-2017.10.03')['d-2017.10.03']['settings']['index']['routing']['allocation'][at][key])
self.assertNotIn('routing',
self.client.indices.get_settings(index='a-2017.10.01')['a-2017.10.01']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='a-2017.10.02')['a-2017.10.02']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='a-2017.10.03')['a-2017.10.03']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='b-2017.10.01')['b-2017.10.01']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='b-2017.10.02')['b-2017.10.02']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='b-2017.10.03')['b-2017.10.03']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='c-2017.10.01')['c-2017.10.01']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='c-2017.10.02')['c-2017.10.02']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='d-2017.10.01')['d-2017.10.01']['settings']['index'])
self.assertNotIn('routing',
self.client.indices.get_settings(index='d-2017.10.02')['d-2017.10.02']['settings']['index'])
idxlist = [
'a-2017.10.01', 'a-2017.10.02', 'a-2017.10.03',
'b-2017.10.01', 'b-2017.10.02', 'b-2017.10.03',
'c-2017.10.01', 'c-2017.10.02',
'd-2017.10.01', 'd-2017.10.02'
]
for idx in idxlist:
if ver >= (7, 10, 0):
self.assertEquals(
EMPTY710ROUTING,
self.client.indices.get_settings(index=idx)[idx]['settings']['index']['routing']
)
else:
self.assertNotIn('routing',
self.client.indices.get_settings(
index=idx)[idx]['settings']['index']
)

0 comments on commit 1f182f2

Please sign in to comment.