Skip to content

Commit ce9465a

Browse files
committed
Test things to the testing dir
1 parent d67c483 commit ce9465a

File tree

3 files changed

+43
-39
lines changed

3 files changed

+43
-39
lines changed

README

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,6 @@ Install the ``elasticsearch`` package with `pip
6666
pip install elasticsearch
6767

6868

69-
Run Elasticsearch in a Container
70-
--------------------------------
71-
72-
To run elasticsearch in a container, optionally set the `ES_VERSION` environment evariable to either 5.4, 5.3 or 2.4. `ES_VERSION` is defaulted to `latest`.
73-
Then run ./start_elasticsearch.sh::
74-
75-
export ES_VERSION=5.4
76-
./start_elasticsearch.sh
77-
78-
79-
This will run a version fo Elastic Search in a Docker container suitable for running the tests. To check that elasticearch is running
80-
first wait for a `healthy` status in `docker ps`::
81-
82-
$ docker ps
83-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
84-
955e57564e53 7d2ad83f8446 "/docker-entrypoin..." 6 minutes ago Up 6 minutes (healthy) 0.0.0.0:9200->9200/tcp, 9300/tcp trusting_brattain
85-
86-
Then you can navigate to `locahost:9200` in your browser.
87-
88-
8969
Example use
9070
-----------
9171

test_elasticsearch/README.rst

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,68 @@
11
elasticsearch-py test suite
22
===========================
33

4-
Warning - by default the tests will try and connect to `localhost:9200` and
4+
Warning - by default the tests will try and connect to ``localhost:9200`` and
55
will destroy all contents of given cluster! The tests also rely on a checkout
6-
of `elasticsearch` repository existing on the same level as the
7-
`elasticsearch-py` clone. Before running the tests we will, by default, pull
8-
latest changes for that repo and perform `git reset --hard` to the exact
6+
of ``elasticsearch`` repository existing on the same level as the
7+
``elasticsearch-py`` clone. Before running the tests we will, by default, pull
8+
latest changes for that repo and perform ``git reset --hard`` to the exact
99
version that was used to build the server we are running against.
1010

1111
Running the tests
1212
-----------------
1313

14-
To simply run the tests just execute the `run_tests.py` script or invoke
15-
`python setup.py test`. The behavior is driven by environmental variables:
14+
To simply run the tests just execute the ``run_tests.py`` script or invoke
15+
``python setup.py test``. The behavior is driven by environmental variables:
1616

17-
* `TEST_ES_SERVER` - can contain "hostname[:port]" of running es cluster
17+
* ``TEST_ES_SERVER`` - can contain "hostname[:port]" of running es cluster
1818

19-
* `TEST_ES_CONNECTION` - name of the connection class to use from
20-
`elasticsearch.connection` module. If you want to run completely with your
19+
* ``TEST_ES_CONNECTION`` - name of the connection class to use from
20+
``elasticsearch.connection`` module. If you want to run completely with your
2121
own see section on customizing tests.
2222

23-
* `TEST_ES_YAML_DIR` - path to the yaml test suite contained in the
24-
elasticsearch repo. Defaults to `$TEST_ES_REPO/rest-api-spec/test`
23+
* ``TEST_ES_YAML_DIR`` - path to the yaml test suite contained in the
24+
elasticsearch repo. Defaults to ``$TEST_ES_REPO/rest-api-spec/test``
2525

26-
* `TEST_ES_REPO` - path to the elasticsearch repo, by default it will look in
27-
the same directory as `elasticsearch-py` is in. It will not be used if
28-
`TEST_ES_YAML_DIR` is specified directly.
26+
* ``TEST_ES_REPO`` - path to the elasticsearch repo, by default it will look in
27+
the same directory as ``elasticsearch-py`` is in. It will not be used if
28+
``TEST_ES_YAML_DIR`` is specified directly.
2929

30-
* `TEST_ES_NOFETCH` - controls if we should fetch new updates to elasticsearch
30+
* ``TEST_ES_NOFETCH`` - controls if we should fetch new updates to elasticsearch
3131
repo and reset it's version to the sha used to build the current es server.
32-
Defaults to `False` which means we will fetch the elasticsearch repo and
33-
`git reset --hard` the sha used to build the server.
32+
Defaults to ``False`` which means we will fetch the elasticsearch repo and
33+
``git reset --hard`` the sha used to build the server.
3434

3535
Alternatively, if you wish to control what you are doing you have several additional options:
3636

37-
* `run_tests.py` will pass any parameters specified to `nosetests`
37+
* ``run_tests.py`` will pass any parameters specified to ``nosetests``
3838

39-
* you can just run your favorite runner in the `test_elasticsearch` directory
39+
* you can just run your favorite runner in the ``test_elasticsearch`` directory
4040
(verified to work with nose and py.test) and bypass the fetch logic entirely.
4141

42+
To install all test dependencies you can also run ``pip install -e .[develop]``.
43+
44+
Run Elasticsearch in a Container
45+
--------------------------------
46+
47+
To run elasticsearch in a container, optionally set the ``ES_VERSION``
48+
environment evariable to either 5.4, 5.3 or 2.4. ``ES_VERSION`` is defaulted to
49+
``latest``. Then run ./start_elasticsearch.sh::
50+
51+
export ES_VERSION=5.4
52+
./start_elasticsearch.sh
53+
54+
55+
This will run a version for Elasticsearch in a Docker container suitable for
56+
running the tests. To check that elasticsearch is running first wait for a
57+
``healthy`` status in ``docker ps``::
58+
59+
$ docker ps
60+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
61+
955e57564e53 7d2ad83f8446 "/docker-entrypoin..." 6 minutes ago Up 6 minutes (healthy) 0.0.0.0:9200->9200/tcp, 9300/tcp trusting_brattain
62+
63+
Then you can navigate to ``locahost:9200`` in your browser.
64+
65+
4266
Customizing the tests
4367
---------------------
4468

File renamed without changes.

0 commit comments

Comments
 (0)