Skip to content

Commit

Permalink
travis: elasticsearch v5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
lnielsen committed Nov 30, 2017
1 parent e67677a commit 99b1ad8
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 16 deletions.
39 changes: 27 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,53 @@ cache:
- $HOME/.cache/pip

services:
- elasticsearch
- redis
- rabbitmq

env:
- REQUIREMENTS=lowest BROKER_URL=redis://localhost:6379/0
- REQUIREMENTS=lowest BROKER_URL=amqp://localhost:5672//
- REQUIREMENTS=release BROKER_URL=redis://localhost:6379/0
- REQUIREMENTS=release BROKER_URL=amqp://localhost:5672//
- REQUIREMENTS=devel BROKER_URL=redis://localhost:6379/0
- REQUIREMENTS=devel BROKER_URL=amqp://localhost:5672//
global:
- ES2_DOWNLOAD_URL="https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.2.0/elasticsearch-2.2.0.tar.gz"
- ES5_DOWNLOAD_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz"
- ES_HOST=127.0.0.1
matrix:
# ES 5: Redis vs RabbitMQ
#- REQUIREMENTS=lowest EXTRAS=all,elasticsearch5 BROKER_URL=redis://localhost:6379/0 ES_URL=$ES5_DOWNLOAD_URL
#- REQUIREMENTS=lowest EXTRAS=all,elasticsearch5 BROKER_URL=amqp://localhost:5672// ES_URL=$ES5_DOWNLOAD_URL
#- REQUIREMENTS=release EXTRAS=all,elasticsearch5 BROKER_URL=redis://localhost:6379/0 ES_URL=$ES5_DOWNLOAD_URL
#- REQUIREMENTS=release EXTRAS=all,elasticsearch5 BROKER_URL=amqp://localhost:5672// ES_URL=$ES5_DOWNLOAD_URL
- REQUIREMENTS=devel EXTRAS=all,elasticsearch5 BROKER_URL=redis://localhost:6379/0 ES_URL=$ES5_DOWNLOAD_URL
#- REQUIREMENTS=devel EXTRAS=all,elasticsearch5 BROKER_URL=amqp://localhost:5672// ES_URL=$ES5_DOWNLOAD_URL
# ES 2: Redis only
#- REQUIREMENTS=lowest EXTRAS=all,elasticsearch2 BROKER_URL=redis://localhost:6379/0 ES_URL=$ES2_DOWNLOAD_URL
#- REQUIREMENTS=release EXTRAS=all,elasticsearch2 BROKER_URL=redis://localhost:6379/0 ES_URL=$ES2_DOWNLOAD_URL
- REQUIREMENTS=devel EXTRAS=all,elasticsearch2 BROKER_URL=redis://localhost:6379/0 ES_URL=$ES2_DOWNLOAD_URL

jdk:
- "oraclejdk8"

python:
- "2.7"
# - "2.7"
- "3.5"
- "pypy"

matrix:
fast_finish: true
allow_failures:
- python: pypy


before_install:
- "mkdir /tmp/elasticsearch"
- "wget -O - $ES_URL | tar xz --directory=/tmp/elasticsearch --strip-components=1"
- "/tmp/elasticsearch/bin/elasticsearch &"
- "sleep 20"
- "travis_retry pip install --upgrade pip setuptools py"
- "travis_retry pip install twine wheel coveralls requirements-builder"
- "requirements-builder --level=min setup.py > .travis-lowest-requirements.txt"
- "requirements-builder --level=pypi setup.py > .travis-release-requirements.txt"
- "requirements-builder --level=dev --req requirements-devel.txt setup.py > .travis-devel-requirements.txt"


install:
- "travis_retry pip install -r .travis-${REQUIREMENTS}-requirements.txt"
- "travis_retry pip install -e .[all]"
- "travis_retry pip install -e .[$EXTRAS]"

script:
- "./run-tests.sh"
Expand Down
23 changes: 23 additions & 0 deletions examples/data/testrecords/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.
27 changes: 27 additions & 0 deletions examples/data/testrecords/v5/testrecord-v1.0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"mappings": {
"testrecord-v1.0.0": {
"properties": {
"control_number": {
"type": "string"
},
"description": {
"type": "string"
},
"participants": {
"type": "long"
},
"title": {
"type": "string",
"copy_to": "suggest_title"
},
"type": {
"type": "string"
},
"suggest_title": {
"type": "completion"
}
}
}
}
}
14 changes: 10 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
tests_require = [
'check-manifest>=0.25',
'coverage>=4.0',
'invenio-db[versioning]>=1.0.0a8',
'invenio-db[versioning]>=1.0.0b9',
'isort>=4.2.2',
'mock>=1.3.0',
'pydocstyle>=1.0.0',
Expand All @@ -45,6 +45,8 @@
'redis>=2.10.0',
]

invenio_search_version = '1.0.0b1'

extras_require = {
'docs:python_version=="2.7"': [
# FIXME remove when celery#3993 will be resolved!
Expand All @@ -53,6 +55,12 @@
'docs': [
'Sphinx>=1.5.1,<1.6',
],
'elasticsearch2': [
'invenio-search[elasticsearch2]>={}'.format(invenio_search_version),
],
'elasticsearch5': [
'invenio-search[elasticsearch5]>={}'.format(invenio_search_version),
],
'tests': tests_require,
}

Expand All @@ -66,10 +74,9 @@

install_requires = [
'Flask>=0.11.1',
'Flask-CeleryExt>=0.2.2',
'Flask-CeleryExt>=0.3.0',
'invenio-pidstore>=1.0.0b1',
'invenio-records>=1.0.0a8',
'invenio-search>=1.0.0a7',
'pytz>=2016.4',
]

Expand Down Expand Up @@ -123,7 +130,6 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Development Status :: 4 - Beta',
],
)
23 changes: 23 additions & 0 deletions tests/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.
23 changes: 23 additions & 0 deletions tests/data/records/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.
File renamed without changes.
1 change: 1 addition & 0 deletions tests/data/records/v5/authorities/authority-v1.0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"mappings": {}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"mappings": {}}
1 change: 1 addition & 0 deletions tests/data/records/v5/default-v1.0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"mappings": {}}

0 comments on commit 99b1ad8

Please sign in to comment.