Commit 019cf969 by Calen Pennington Committed by Clinton Blackburn

Use elasticsearch via docker, so that we can test against ES 1.5.2

parent 06a4c17d
language: python language: python
python: python:
- "3.5" - "3.5"
services:
- docker
sudo: false sudo: false
# Cache the pip directory. "cache: pip" doesn't work due to install override. See https://github.com/travis-ci/travis-ci/issues/3239. # Cache the pip directory. "cache: pip" doesn't work due to install override. See https://github.com/travis-ci/travis-ci/issues/3239.
cache: cache:
- directories: - directories:
- $HOME/.cache/pip - $HOME/.cache/pip
before_install: before_install:
- "export DISPLAY=:99.0" - "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start" - "sh -e /etc/init.d/xvfb start"
- docker run --detach --publish 9200:9200 --publish 9300:9300 elasticsearch:1.5.2
install: install:
- pip install -U pip wheel codecov - pip install -U pip wheel codecov
- pip install -r requirements/test.txt - pip install -r requirements/test.txt
before_script:
# Give Elasticsearch time to start
- sleep 10
script: script:
- make validate - make validate
branches:
only:
- master
after_success: after_success:
- codecov - codecov
import os import os
from course_discovery.settings.base import * from course_discovery.settings.base import *
# TEST SETTINGS # TEST SETTINGS
INSTALLED_APPS += ( INSTALLED_APPS += (
'django_nose', 'django_nose',
...@@ -31,3 +29,9 @@ DATABASES = { ...@@ -31,3 +29,9 @@ DATABASES = {
}, },
} }
# END IN-MEMORY TEST DATABASE # END IN-MEMORY TEST DATABASE
ELASTICSEARCH = {
'host': os.environ.get('TEST_ELASTICSEARCH_HOST', 'localhost'),
'index': 'course_discovery_test',
'connect_on_startup': True
}
...@@ -34,6 +34,8 @@ course-discovery: ...@@ -34,6 +34,8 @@ course-discovery:
volumes: volumes:
- .:/edx/app/course_discovery/course_discovery - .:/edx/app/course_discovery/course_discovery
command: /edx/app/course_discovery/devstack.sh start command: /edx/app/course_discovery/devstack.sh start
environment:
TEST_ELASTICSEARCH_HOST: "es"
ports: ports:
- "18381:18381" - "18381:18381"
- "8381:8381" - "8381:8381"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment