diff --git a/test_elasticsearch/README.rst b/test_elasticsearch/README.rst index e915150f..13f49b57 100644 --- a/test_elasticsearch/README.rst +++ b/test_elasticsearch/README.rst @@ -2,7 +2,11 @@ elasticsearch-py test suite =========================== Warning - by default the tests will try and connect to `localhost:9200` and -will destroy all contents of given cluster! +will destroy all contents of given cluster! The tests also rely on a checkout +of `elasticsearch` repository existing on the same level as the +`elasticsearch-py` clone. Before running the tests we will, by default, pull +latest changes for that repo and perform `git reset --hard` to the exact +version that was used to build the server we are running against. Running the tests ----------------- @@ -26,7 +30,7 @@ To simply run the tests just execute the `run_tests.py` script or invoke * `TEST_ES_NOFETCH` - controls if we should fetch new updates to elasticsearch repo and reset it's version to the sha used to build the current es server. Defaults to `False` which means we will fetch the elasticsearch repo and - `git checkout` the sha used to build the server. + `git reset --hard` the sha used to build the server. Alternatively, if you wish to control what you are doing you have several additional options: diff --git a/test_elasticsearch/run_tests.py b/test_elasticsearch/run_tests.py index a5cb2aed..bb86b18d 100755 --- a/test_elasticsearch/run_tests.py +++ b/test_elasticsearch/run_tests.py @@ -47,7 +47,7 @@ def fetch_es_repo(): print('Fetching elasticsearch repo...') subprocess.check_call('cd %s && git fetch https://github.com/elasticsearch/elasticsearch.git' % repo_path, shell=True) # reset to the version fron info() - subprocess.check_call('cd %s && git checkout %s' % (repo_path, sha), shell=True) + subprocess.check_call('cd %s && git reset --hard %s' % (repo_path, sha), shell=True) def run_all(argv=None): sys.exitfunc = lambda: sys.stderr.write('Shutting down....\n')