Skip to content

Commit

Permalink
Merge pull request #16 from fizyk/option_helps
Browse files Browse the repository at this point in the history
add descriptions for all command line and ini options
  • Loading branch information
fizyk committed Aug 17, 2016
2 parents e30600a + 874db9e commit 578a8ed
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGELOG
unreleased
-------

- [docs] added description to all command line and ini options
- [bugfix] made command line option's dests more distinc, to prevent from influencing other pytest plugins

1.0.0
Expand Down
4 changes: 1 addition & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ You can pick which you prefer, but remember that these settings are handled in t
+----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+----------------------------+
| logs prefix | logs_prefix | --elasticsearch-logs-prefix | elasticsearch_logs_prefix | |
+----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+----------------------------+
| discovery en ping | | | | |
| multicast enabled | discovery_zen_ping_multicast_enabled | --elasticsearch-discovery-zen-ping-multicast-enabled | elasticsearch_discovery_zen_ping_multicast_enabled | False |
| | | | | |
| enable zen discovery | discovery_zen_ping_multicast_enabled | --elasticsearch-discovery-zen-ping-multicast-enabled | elasticsearch_discovery_zen_ping_multicast_enabled | False |
+----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+----------------------------+


Expand Down
25 changes: 20 additions & 5 deletions src/pytest_elasticsearch/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,35 @@

from pytest_elasticsearch import factories

_help_logsdir = 'Elasticsearch logs directory'
_help_host = 'Elasticsearch host'
_help_port = 'Elasticsearch port'
_help_cluster_name = 'Cluster name of the elasticsearch process fixture'
_help_index_store_type = \
'type of the index to use in the elasticsearch process fixture'
_help_network_publish_host = \
'network host to which elasticsearch publish to connect to cluseter'
_help_logs_prefix = 'prefix for the logs file'
_help_discovery_zen_ping_multicast_enabled = 'Use zen discovery'


def pytest_addoption(parser):
"""Add plugin's configuration options."""
parser.addini(
name='elasticsearch_logsdir',
help='',
help=_help_logsdir,
default='/tmp'
)

parser.addini(
name='elasticsearch_host',
help='',
help=_help_host,
default='127.0.0.1'
)

parser.addini(
name='elasticsearch_cluster_name',
help='',
help=_help_cluster_name,
default=''
)

Expand Down Expand Up @@ -67,7 +78,7 @@ def pytest_addoption(parser):

parser.addini(
name='elasticsearch_port',
help='',
help=_help_port,
default=9201,
)

Expand All @@ -76,18 +87,21 @@ def pytest_addoption(parser):
action='store',
metavar='path',
dest='elasticsearch_logsdir',
help=_help_logsdir
)

parser.addoption(
'--elasticsearch-host',
action='store',
dest='elasticsearch_host',
help=_help_host,
)

parser.addoption(
'--elasticsearch-cluster-name',
action='store',
dest='elasticsearch_cluster_name',
help=_help_cluster_name,
)

parser.addoption(
Expand Down Expand Up @@ -117,7 +131,8 @@ def pytest_addoption(parser):
parser.addoption(
'--elasticsearch-port',
action='store',
dest='elasticsearch_port'
dest='elasticsearch_port',
help=_help_port
)

elasticsearch_proc = factories.elasticsearch_proc()
Expand Down

0 comments on commit 578a8ed

Please sign in to comment.