Remove ES 1.x from test configuration

pull/3999/head
Karl Hobley 2017-11-06 10:51:31 +00:00 zatwierdzone przez Matt Westcott
rodzic 5fd1cfd3c0
commit 0a52196c63
5 zmienionych plików z 5 dodań i 25 usunięć

Wyświetl plik

@ -18,9 +18,6 @@ matrix:
python: 3.4
- env: TOXENV=py34-dj111-sqlite-noelasticsearch
python: 3.4
- env: TOXENV=py34-dj111-postgres-elasticsearch INSTALL_ELASTICSEARCH1=yes
python: 3.4
sudo: true
- env: TOXENV=py35-dj111-postgres-noelasticsearch
python: 3.5
- env: TOXENV=py35-dj111-mysql-noelasticsearch
@ -34,9 +31,6 @@ matrix:
python: 3.6
- env: TOXENV=py36-dj111-mysql-noelasticsearch
python: 3.6
- env: TOXENV=py36-dj111-postgres-elasticsearch INSTALL_ELASTICSEARCH1=yes
python: 3.6
sudo: true
- env: TOXENV=py36-dj111-postgres-elasticsearch2 INSTALL_ELASTICSEARCH2=yes
python: 3.6
sudo: true
@ -45,9 +39,7 @@ matrix:
sudo: true
allow_failures:
# Ignore failures on Elasticsearch tests because ES on Travis is intermittently flaky
- env: TOXENV=py34-dj111-postgres-elasticsearch INSTALL_ELASTICSEARCH1=yes
- env: TOXENV=py35-dj111-postgres-elasticsearch2 INSTALL_ELASTICSEARCH2=yes
- env: TOXENV=py36-dj111-postgres-elasticsearch INSTALL_ELASTICSEARCH1=yes
- env: TOXENV=py36-dj111-postgres-elasticsearch2 INSTALL_ELASTICSEARCH2=yes
- env: TOXENV=py36-dj111-postgres-elasticsearch5 INSTALL_ELASTICSEARCH5=yes
@ -58,7 +50,6 @@ services:
# Package installation
install:
- pip install tox codecov
- 'if [[ -n "$INSTALL_ELASTICSEARCH1" ]]; then ./scripts/travis/install_elasticsearch1.sh; fi'
- 'if [[ -n "$INSTALL_ELASTICSEARCH2" ]]; then ./scripts/travis/install_elasticsearch2.sh; fi'
- 'if [[ -n "$INSTALL_ELASTICSEARCH5" ]]; then ./scripts/travis/install_elasticsearch5.sh; fi'

Wyświetl plik

@ -17,7 +17,6 @@ def make_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--deprecation', choices=['all', 'pending', 'imminent', 'none'], default='imminent')
parser.add_argument('--postgres', action='store_true')
parser.add_argument('--elasticsearch', action='store_true')
parser.add_argument('--elasticsearch2', action='store_true')
parser.add_argument('--elasticsearch5', action='store_true')
return parser
@ -49,18 +48,15 @@ def runtests():
if args.postgres:
os.environ['DATABASE_ENGINE'] = 'django.db.backends.postgresql'
if args.elasticsearch:
os.environ.setdefault('ELASTICSEARCH_URL', 'http://localhost:9200')
os.environ.setdefault('ELASTICSEARCH_VERSION', '1')
if args.elasticsearch2:
raise RuntimeError("You cannot test both Elasticsearch 1 and 2 together")
elif args.elasticsearch2:
if args.elasticsearch2:
os.environ.setdefault('ELASTICSEARCH_URL', 'http://localhost:9200')
os.environ.setdefault('ELASTICSEARCH_VERSION', '2')
elif args.elasticsearch5:
os.environ.setdefault('ELASTICSEARCH_URL', 'http://localhost:9200')
os.environ.setdefault('ELASTICSEARCH_VERSION', '5')
if args.elasticsearch2:
raise RuntimeError("You cannot test both Elasticsearch 2 and 5 together")
elif 'ELASTICSEARCH_URL' in os.environ:
# forcibly delete the ELASTICSEARCH_URL setting to skip those tests
del os.environ['ELASTICSEARCH_URL']

Wyświetl plik

@ -1,3 +0,0 @@
#!/bin/bash
curl -O https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.6.deb && sudo dpkg -i --force-confnew elasticsearch-1.7.6.deb && sudo service elasticsearch restart

Wyświetl plik

@ -2,7 +2,7 @@
skipsdist = True
usedevelop = True
envlist = py{34,35,36}-dj111-{sqlite,postgres,mysql,mssql}-{elasticsearch5,elasticsearch2,elasticsearch,noelasticsearch},
envlist = py{34,35,36}-dj111-{sqlite,postgres,mysql,mssql}-{elasticsearch5,elasticsearch2,noelasticsearch},
[flake8]
# D100: Missing docstring in public module
@ -26,7 +26,6 @@ ignore = D100,D101,D102,D103,D105,D200,D202,D204,D205,D209,D400,D401,E303,E501,N
[testenv]
install_command = pip install -e ".[testing]" -U {opts} {packages}
commands =
elasticsearch: coverage run runtests.py wagtail.wagtailsearch wagtail.wagtaildocs wagtail.wagtailimages --elasticsearch
elasticsearch2: coverage run runtests.py wagtail.wagtailsearch wagtail.wagtaildocs wagtail.wagtailimages --elasticsearch2
elasticsearch5: coverage run runtests.py wagtail.wagtailsearch wagtail.wagtaildocs wagtail.wagtailimages --elasticsearch5
noelasticsearch: coverage run runtests.py
@ -44,7 +43,6 @@ deps =
dj111-mssql: django-pyodbc-azure==1.11.0.0
postgres: psycopg2>=2.6
mysql: mysqlclient==1.3.6
elasticsearch: elasticsearch>=1,<2
elasticsearch2: elasticsearch>=2,<3
elasticsearch5: elasticsearch>=5,<6
elasticsearch5: certifi

Wyświetl plik

@ -177,8 +177,6 @@ if 'ELASTICSEARCH_URL' in os.environ:
backend = 'wagtail.wagtailsearch.backends.elasticsearch5'
elif os.environ.get('ELASTICSEARCH_VERSION') == '2':
backend = 'wagtail.wagtailsearch.backends.elasticsearch2'
else:
backend = 'wagtail.wagtailsearch.backends.elasticsearch'
WAGTAILSEARCH_BACKENDS['elasticsearch'] = {
'BACKEND': backend,