Skip to content

Commit

Permalink
Changed the order of executable configuration resolve, filled in README
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk committed May 10, 2021
1 parent d2bce58 commit ddde1fd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 7 additions & 0 deletions README.rst
@@ -1,3 +1,4 @@

.. image:: https://raw.githubusercontent.com/ClearcodeHQ/pytest-elasticsearch/master/logo.png
:width: 100px
:height: 100px
Expand Down Expand Up @@ -105,6 +106,12 @@ You can pick which you prefer, but remember that these settings are handled in t
- pytest.ini option
- Noop process fixture
- Default
* - Elasticsearch executable
- executable
- --elasticsearch_executable
- elasticsearch_executable
-
- /usr/share/elasticsearch/bin/elasticsearch
* - logs directory
- logsdir
- --elasticsearch-logsdir
Expand Down
6 changes: 3 additions & 3 deletions src/pytest_elasticsearch/factories.py
Expand Up @@ -47,7 +47,7 @@ def return_config(request):
return config


def elasticsearch_proc(executable='/usr/share/elasticsearch/bin/elasticsearch',
def elasticsearch_proc(executable=None,
host=None, port=-1, transport_tcp_port=None,
cluster_name=None, network_publish_host=None,
index_store_type=None, logs_prefix=None,
Expand Down Expand Up @@ -84,7 +84,7 @@ def elasticsearch_proc_fixture(request):
"""Elasticsearch process starting fixture."""
config = return_config(request)
elasticsearch_host = host or config['host']
executable = config['executable'] or executable
elasticsearch_executable = executable or config['executable']

elasticsearch_port = get_port(port) or get_port(config['port'])
elasticsearch_transport_port = get_port(transport_tcp_port) or \
Expand Down Expand Up @@ -112,7 +112,7 @@ def elasticsearch_proc_fixture(request):
gettempdir(), 'elasticsearch_{0}_tmp'.format(elasticsearch_port))

elasticsearch_executor = ElasticSearchExecutor(
executable,
elasticsearch_executable,
elasticsearch_host,
elasticsearch_port,
elasticsearch_transport_port,
Expand Down
5 changes: 2 additions & 3 deletions src/pytest_elasticsearch/plugin.py
Expand Up @@ -52,7 +52,7 @@ def pytest_addoption(parser):

parser.addini(
name='elasticsearch_executable',
help=_help_host,
help=_help_executable,
default='/usr/share/elasticsearch/bin/elasticsearch'
)

Expand Down Expand Up @@ -110,8 +110,7 @@ def pytest_addoption(parser):
'--elasticsearch_executable',
action='store',
dest='elasticsearch_executable',
help=_help_host,
default='/usr/share/elasticsearch/bin/elasticsearch'
help=_help_executable,
)

parser.addoption(
Expand Down

0 comments on commit ddde1fd

Please sign in to comment.