Perform git reset --hard on the elasticsearch repo when running tests.

This commit is contained in:
Honza Král
2014-03-26 18:46:14 +01:00
parent 67d2c7c6d1
commit d205cbfbb5
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -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:
+1 -1
View File
@@ -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')