ClearcodeHQ/pytest-elasticsearch

elasticsearch 2.* support

Closed this issue · 1 comments

fizyk commented

From @dron22 on April 22, 2016 15:39

The elasticsearch factory does not yet fully support versions >= 2.0. Upon index creation the following Exception is raised:

RequestError: TransportError(400, u'illegal_argument_exception', u'failed to create index')

elasticsearch logs:

2016-04-22 13:15:15,426][DEBUG][action.admin.indices.create] [Brutacus] [test] failed to create
[test] IndexCreationException[failed to create index]; nested: IllegalArgumentException[Unknown store type [memory]];
at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:362)
...

The error can be reproduced in a test like this:

def test_index_creation(elasticsearch):
    elasticsearch.indices.create(index='mytestindex')

The reason is that in-memory indexes are no longer supported

Copied from original issue: ClearcodeHQ/pytest-dbfixtures#148

fizyk commented

From @dron22 on April 22, 2016 15:44

Furthermore the status attribute was removed from the info() output on the elasticsearch client. Thus existing test:

def test_elasticsarch(elasticsearch):
    """Tests if elasticsearch fixtures connects to process."""
    info = elasticsearch.info()
    assert info['status'] == 200

Results in error:

assert elasticsearch_random.info()['status'] == 200
E       KeyError: 'status'