Skip to content

Commit de11205

Browse files
committed
[timseries] Fix tests
1 parent f9cb792 commit de11205

File tree

16 files changed

+205
-95
lines changed

16 files changed

+205
-95
lines changed

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ addons:
2424

2525
services:
2626
- docker
27-
- redis-server
28-
- elasticsearch
2927

3028
branches:
3129
only:
3230
- master
3331
- dev
3432

3533
before_install:
36-
# - docker run -d --name influxdb -e INFLUXDB_DB=openwisp2 -p 8086:8086 influxdb:alpine
37-
# - docker run -p 9200:9200 docker.elastic.co/elasticsearch/elasticsearch:7.8.0
34+
- docker-compose up -d
35+
# - docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.0.1
3836
- pip install -U pip wheel setuptools
3937
- pip install $DJANGO
4038
- pip install -U -r requirements-test.txt
@@ -46,6 +44,7 @@ install:
4644
script:
4745
- ./run-qa-checks
4846
- SAMPLE_APP=1 coverage run --source=openwisp_monitoring runtests.py
47+
- coverage report -m
4948
- coverage run -a --source=openwisp_monitoring runtests.py
5049

5150
jobs:

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ WORKDIR /opt/openwisp/tests/
1919
ENV NAME=openwisp-monitoring \
2020
PYTHONBUFFERED=1 \
2121
INFLUXDB_HOST=influxdb \
22-
REDIS_HOST=redis
22+
REDIS_HOST=redis \
23+
ELASTICSEARCH_HOST=es01
2324
CMD ["sh", "docker-entrypoint.sh"]
2425
EXPOSE 8000

docker-compose.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ services:
1111
depends_on:
1212
- influxdb
1313
- redis
14+
- es01
15+
- es02
1416

1517
influxdb:
1618
image: influxdb:1.8-alpine
@@ -23,24 +25,45 @@ services:
2325
INFLUXDB_USER: openwisp
2426
INFLUXDB_USER_PASSWORD: openwisp
2527
# clustered version of elasticsearch is used as that might be used in production
26-
elasticsearch:
28+
es01:
2729
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
2830
container_name: es01
2931
environment:
30-
- node.name: openwisp2
31-
- cluster.name: openwisp2
32-
- bootstrap.memory_lock: true
32+
- "node.name=es01"
33+
- "discovery.seed_hosts=es02"
34+
- "cluster.initial_master_nodes=es01,es02"
35+
- "cluster.name=openwisp2"
36+
- "bootstrap.memory_lock=true"
3337
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
3438
ulimits:
3539
memlock:
3640
soft: -1
3741
hard: -1
3842
volumes:
39-
- data01:/usr/share/elasticsearch/data
43+
- esdata01:/usr/share/elasticsearch/data
4044
ports:
4145
- 9200:9200
4246
networks:
43-
- elastic
47+
- esnet
48+
es02:
49+
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
50+
container_name: es02
51+
environment:
52+
- "node.name=es02"
53+
- "discovery.seed_hosts=es01"
54+
- "cluster.initial_master_nodes=es01,es02"
55+
- "cluster.name=openwisp2"
56+
- "bootstrap.memory_lock=true"
57+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
58+
ulimits:
59+
memlock:
60+
soft: -1
61+
hard: -1
62+
volumes:
63+
- esdata02:/usr/share/elasticsearch/data
64+
networks:
65+
- esnet
66+
4467
redis:
4568
image: redis:5.0-alpine
4669
ports:
@@ -49,7 +72,10 @@ services:
4972

5073
volumes:
5174
influxdb-data: {}
75+
esdata01:
76+
driver: local
77+
esdata02:
78+
driver: local
5279

5380
networks:
54-
elastic:
55-
driver: bridge
81+
esnet:

0 commit comments

Comments
 (0)