add elasticsearch service to gitlab
This commit is contained in:
parent
1e28e21ab5
commit
46dd389d0d
3 changed files with 11 additions and 4 deletions
|
@ -1,5 +1,11 @@
|
|||
default:
|
||||
image: python:3.7
|
||||
services:
|
||||
- name: docker.elastic.co/elasticsearch/elasticsearch:7.11.2
|
||||
alias: elasticsearch
|
||||
command: [ "bin/elasticsearch", "-Expack.security.enabled=false", "-Ediscovery.type=single-node" ]
|
||||
variables:
|
||||
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
|
||||
|
||||
|
||||
#cache:
|
||||
|
@ -41,13 +47,14 @@ test:datanetwork-integration:
|
|||
stage: test
|
||||
script:
|
||||
- pip install tox-travis
|
||||
- tox -e datanetwork --recreate
|
||||
- ELASTIC_HOST=elasticsearch tox -e datanetwork --recreate
|
||||
|
||||
test:blockchain-integration:
|
||||
stage: test
|
||||
script:
|
||||
- curl "http://elasticsearch:9200/_cat/health"
|
||||
- pip install tox-travis
|
||||
- tox -e blockchain
|
||||
- ELASTIC_HOST=elasticsearch tox -e blockchain
|
||||
|
||||
test:other-integration:
|
||||
stage: test
|
||||
|
@ -55,7 +62,7 @@ test:other-integration:
|
|||
- apt-get update
|
||||
- apt-get install -y --no-install-recommends ffmpeg
|
||||
- pip install tox-travis
|
||||
- tox -e other
|
||||
- ELASTIC_HOST=elasticsearch tox -e other
|
||||
|
||||
test:json-api:
|
||||
stage: test
|
||||
|
|
|
@ -54,7 +54,6 @@ class SearchIndex:
|
|||
self.sync_client = AsyncElasticsearch(hosts, timeout=self.sync_timeout)
|
||||
self.search_client = AsyncElasticsearch(hosts, timeout=self.search_timeout)
|
||||
while True:
|
||||
self.logger.info("DOITDOITDOIT\n\n\n\n%s:%i\n\n\n", self._elastic_host, self._elastic_port)
|
||||
try:
|
||||
await self.sync_client.cluster.health(wait_for_status='yellow')
|
||||
break
|
||||
|
|
1
tox.ini
1
tox.ini
|
@ -6,6 +6,7 @@ extras = test
|
|||
changedir = {toxinidir}/tests
|
||||
setenv =
|
||||
HOME=/tmp
|
||||
ELASTIC_HOST=localhost
|
||||
commands =
|
||||
pip install https://github.com/rogerbinns/apsw/releases/download/3.30.1-r1/apsw-3.30.1-r1.zip \
|
||||
--global-option=fetch \
|
||||
|
|
Loading…
Reference in a new issue