Skip to content

Commit

Permalink
Test newer 7.x elasticsearch versions - refs #257
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk committed Aug 27, 2020
1 parent b764b95 commit 743cc1a
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 32 deletions.
10 changes: 7 additions & 3 deletions .travis.install-elasticsearch.sh
Expand Up @@ -29,6 +29,10 @@ function remove_if_erroneus {
}

install_from_zip https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.16.zip elasticsearch-5.6.16
install_from_zip https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.3.zip elasticsearch-6.8.3
install_from_targz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.2-linux-x86_64.tar.gz elasticsearch-7.3.2
install_from_targz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.1-linux-x86_64.tar.gz elasticsearch-7.4.1
install_from_zip https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.12.zip elasticsearch-6.8.12
install_from_targz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.2-linux-x86_64.tar.gz elasticsearch-7.4.2
install_from_targz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.2-linux-x86_64.tar.gz elasticsearch-7.5.2
install_from_targz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz elasticsearch-7.6.2
install_from_targz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.7.1-linux-x86_64.tar.gz elasticsearch-7.7.1
install_from_targz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.8.1-linux-x86_64.tar.gz elasticsearch-7.8.1
install_from_targz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.0-linux-x86_64.tar.gz elasticsearch-7.9.0
4 changes: 3 additions & 1 deletion .travis.yml
@@ -1,5 +1,4 @@
dist: xenial
sudo: true
language: python
python:
- 3.8
Expand All @@ -8,6 +7,9 @@ python:
- 3.9-dev
- nightly
- pypy3
env:
global:
- ES_JAVA_OPTS="-Xms256m -Xmx256m"
# blocklist branches
branches:
except:
Expand Down
6 changes: 0 additions & 6 deletions README.rst
Expand Up @@ -153,12 +153,6 @@ You can pick which you prefer, but remember that these settings are handled in t
- elasticsearch_transport_tcp_port
- -
- random
* - configuration path
- configuration_path
- --elasticsearch-configuration-path
- elasticsearch_configuration_path
- -
- /etc/elasticsearch

Example usage:

Expand Down
30 changes: 23 additions & 7 deletions tests/conftest.py
Expand Up @@ -7,9 +7,13 @@


ELASTICSEARCH_EXECUTABLE_5_6 = '/opt/es/elasticsearch-5.6.16/bin/elasticsearch'
ELASTICSEARCH_EXECUTABLE_6_8 = '/opt/es/elasticsearch-6.8.3/bin/elasticsearch'
ELASTICSEARCH_EXECUTABLE_7_3 = '/opt/es/elasticsearch-7.3.2/bin/elasticsearch'
ELASTICSEARCH_EXECUTABLE_7_4 = '/opt/es/elasticsearch-7.4.1/bin/elasticsearch'
ELASTICSEARCH_EXECUTABLE_6_8 = '/opt/es/elasticsearch-6.8.12/bin/elasticsearch'
ELASTICSEARCH_EXECUTABLE_7_4 = '/opt/es/elasticsearch-7.4.2/bin/elasticsearch'
ELASTICSEARCH_EXECUTABLE_7_5 = '/opt/es/elasticsearch-7.5.2/bin/elasticsearch'
ELASTICSEARCH_EXECUTABLE_7_6 = '/opt/es/elasticsearch-7.6.2/bin/elasticsearch'
ELASTICSEARCH_EXECUTABLE_7_7 = '/opt/es/elasticsearch-7.7.1/bin/elasticsearch'
ELASTICSEARCH_EXECUTABLE_7_8 = '/opt/es/elasticsearch-7.8.1/bin/elasticsearch'
ELASTICSEARCH_EXECUTABLE_7_9 = '/opt/es/elasticsearch-7.9.0/bin/elasticsearch'


def elasticsearch_fixture_factory(executable, proc_name, port, **kwargs):
Expand All @@ -26,15 +30,27 @@ def elasticsearch_fixture_factory(executable, proc_name, port, **kwargs):
elasticsearch_proc_6_8, elasticsearch_6_8 = elasticsearch_fixture_factory(
ELASTICSEARCH_EXECUTABLE_6_8, 'elasticsearch_proc_6_8', port=None
)
elasticsearch_proc_7_3, elasticsearch_7_3 = elasticsearch_fixture_factory(
ELASTICSEARCH_EXECUTABLE_7_3, 'elasticsearch_proc_7_3', port=None
)
elasticsearch_proc_7_4, elasticsearch_7_4 = elasticsearch_fixture_factory(
ELASTICSEARCH_EXECUTABLE_7_4, 'elasticsearch_proc_7_4', port=None
)
elasticsearch_proc_7_5, elasticsearch_7_5 = elasticsearch_fixture_factory(
ELASTICSEARCH_EXECUTABLE_7_5, 'elasticsearch_proc_7_5', port=None
)
elasticsearch_proc_7_6, elasticsearch_7_6 = elasticsearch_fixture_factory(
ELASTICSEARCH_EXECUTABLE_7_6, 'elasticsearch_proc_7_6', port=None
)
elasticsearch_proc_7_7, elasticsearch_7_7 = elasticsearch_fixture_factory(
ELASTICSEARCH_EXECUTABLE_7_7, 'elasticsearch_proc_7_7', port=None
)
elasticsearch_proc_7_8, elasticsearch_7_8 = elasticsearch_fixture_factory(
ELASTICSEARCH_EXECUTABLE_7_8, 'elasticsearch_proc_7_8', port=None
)
elasticsearch_proc_7_9, elasticsearch_7_9 = elasticsearch_fixture_factory(
ELASTICSEARCH_EXECUTABLE_7_9, 'elasticsearch_proc_7_9', port=None
)

elasticsearch_proc2 = factories.elasticsearch_proc(
executable=ELASTICSEARCH_EXECUTABLE_7_4, port=9393
executable=ELASTICSEARCH_EXECUTABLE_7_9, port=9393
)
elasticsearch_nooproc2 = factories.elasticsearch_noproc(port=9393)
elasticsearch2 = factories.elasticsearch('elasticsearch_proc2')
Expand Down
66 changes: 51 additions & 15 deletions tests/test_elastic.py
Expand Up @@ -18,14 +18,8 @@
VERSION_STRING_6_8 = (
'OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was '
'deprecated in version 9.0 and will likely be removed in a future release.'
'\nVersion: 6.8.2, Build: default/zip/b506955/2019-07-24T15:24:41.545295Z, '
'JVM: 11.0.2'
)
VERSION_STRING_6_8_3 = (
'OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was '
'deprecated in version 9.0 and will likely be removed in a future release.'
'\nVersion: 6.8.3, Build: default/zip/0c48c0e/2019-08-29T19:05:24.312154Z, '
'JVM: 11.0.2'
'\nVersion: 6.8.12, Build: default/zip/7a15d2a/2020-08-12T07:27:20.804867Z,'
' JVM: 11.0.2'
)
VERSION_STRING_7_3 = (
'OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was '
Expand All @@ -42,18 +36,52 @@
VERSION_STRING_7_4 = (
'OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was '
'deprecated in version 9.0 and will likely be removed in a future release.'
'\nVersion: 7.4.1, Build: default/tar/fc0eeb6e2c25915d63d871d344e3d0b45ea0e'
'a1e/2019-10-22T17:16:35.176724Z, JVM: 11.0.2'
'\nVersion: 7.4.2, Build: default/tar/2f90bbf7b93631e52bafb59b3b049cb44ec25'
'e96/2019-10-28T20:40:44.881551Z, JVM: 11.0.2'
)
VERSION_STRING_7_5 = (
'OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was '
'deprecated in version 9.0 and will likely be removed in a future release.'
'\nVersion: 7.5.2, Build: default/tar/8bec50e1e0ad29dad5653712cf3bb580cd1af'
'cdf/2020-01-15T12:11:52.313576Z, JVM: 11.0.2'
)
VERSION_STRING_7_6 = (
'OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was '
'deprecated in version 9.0 and will likely be removed in a future release.'
'\nVersion: 7.6.2, Build: default/tar/ef48eb35cf30adf4db14086e8aabd07ef6fb1'
'13f/2020-03-26T06:34:37.794943Z, JVM: 11.0.2'
)
VERSION_STRING_7_7 = (
'OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was '
'deprecated in version 9.0 and will likely be removed in a future release.'
'\nVersion: 7.7.1, Build: default/tar/ad56dce891c901a492bb1ee393f12dfff473a'
'423/2020-05-28T16:30:01.040088Z, JVM: 11.0.2'
)
VERSION_STRING_7_8 = (
'OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was '
'deprecated in version 9.0 and will likely be removed in a future release.'
'\nVersion: 7.8.1, Build: default/tar/b5ca9c58fb664ca8bf9e4057fc229b3396bf3'
'a89/2020-07-21T16:40:44.668009Z, JVM: 11.0.2'
)
VERSION_STRING_7_9 = (
'OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was '
'deprecated in version 9.0 and will likely be removed in a future release.'
'\nVersion: 7.9.0, Build: default/tar/a479a2a7fce0389512d6a9361301708b92dff'
'667/2020-08-11T21:36:48.204330Z, JVM: 11.0.2'
)


@pytest.mark.parametrize('output, expected_version', (
(VERSION_STRING_5_6, '5.6.16'),
(VERSION_STRING_6_8, '6.8.2'),
(VERSION_STRING_6_8_3, '6.8.3'),
(VERSION_STRING_6_8, '6.8.12'),
(VERSION_STRING_7_3, '7.3.0'),
(VERSION_STRING_7_3_2, '7.3.2'),
(VERSION_STRING_7_4, '7.4.1'),
(VERSION_STRING_7_4, '7.4.2'),
(VERSION_STRING_7_5, '7.5.2'),
(VERSION_STRING_7_6, '7.6.2'),
(VERSION_STRING_7_7, '7.7.1'),
(VERSION_STRING_7_8, '7.8.1'),
(VERSION_STRING_7_9, '7.9.0'),
))
def test_version_extraction(output, expected_version):
"""Verify if we can properly extract elasticsearch version."""
Expand All @@ -73,8 +101,12 @@ def test_version_extraction(output, expected_version):
@pytest.mark.parametrize('elasticsearch_proc_name', (
'elasticsearch_proc_5_6',
'elasticsearch_proc_6_8',
'elasticsearch_proc_7_3',
'elasticsearch_proc_7_4',
'elasticsearch_proc_7_5',
'elasticsearch_proc_7_6',
'elasticsearch_proc_7_7',
'elasticsearch_proc_7_8',
'elasticsearch_proc_7_9',
))
def test_elastic_process(request, elasticsearch_proc_name):
"""Simple test for starting elasticsearch_proc."""
Expand All @@ -85,8 +117,12 @@ def test_elastic_process(request, elasticsearch_proc_name):
@pytest.mark.parametrize('elasticsearch_name', (
'elasticsearch_5_6',
'elasticsearch_6_8',
'elasticsearch_7_3',
'elasticsearch_7_4',
'elasticsearch_7_5',
'elasticsearch_7_6',
'elasticsearch_7_7',
'elasticsearch_7_8',
'elasticsearch_7_9',
))
def test_elasticsearch(request, elasticsearch_name):
"""Test if elasticsearch fixtures connects to process."""
Expand Down

0 comments on commit 743cc1a

Please sign in to comment.