Closed Bug 1389132 Opened 7 years ago Closed 7 years ago

How to set elasticsearch url for all test cases to use? (validate new external elasticsearch server)

Categories

(Webtools Graveyard :: DXR, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: michael.l.schneider, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36

Steps to reproduce:

I need to validate an external elasticsearch server and  then change localhost:9200 to docker_es_1:9200.

Docker has depricated linking ports, so would like to use elasticsearch container name or host name



Expected results:

I would like to be able to set the URL for all test cases,  via environment variable if possible, by config file if necessary

I am hitting this when porting elasticsearch to 5.5 and updating docker-compose format to version 3.


Note: this may be very easy to do today with the python config system, but I am not sure how to do this.

I want to override the   es_hosts parameter in the dxr.config file used by all tests.

[DXR]
   es_hosts            = http://192.168.1.86:9200/
DXR's config system is pre-Docker and so doesn't do anything with env vars. To quickly and dirtily point the tests to another box, edit this line in config.py:

    Optional('es_hosts', default='http://127.0.0.1:9200/'):

…and this line in testing.py:

    return ElasticSearch('http://127.0.0.1:9200/')

I'm sure you could do it somehow within Docker as well. Worst case, you could open an ssh tunnel (http://www.revsys.com/writings/quicktips/ssh-tunnel.html). But I'm sure there is some new Docker feature to replace linking. (I'm a few versions behind, as I haven't been using it lately.)
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.