Skip to content

Commit

Permalink
Enable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Surgo committed Jun 13, 2021
1 parent a4a1c54 commit 46f1b4e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
matrix:
django-version: [2.2, 3.1, 3.2]
python-version: [3.6, 3.7, 3.8, 3.9]
elastic-version: [1.7, 2.4, 5.5]
elastic-version: [1.7, 2.4, 5.5, '7.13.1']
include:
- django-version: 2.2
python-version: 3.5
Expand All @@ -21,6 +21,9 @@ jobs:
- django-version: 2.2
python-version: 3.5
elastic-version: 5.5
- django-version: 2.2
python-version: 3.5
elastic-version: '7.13.1'
services:
elastic:
image: elasticsearch:${{ matrix.elastic-version }}
Expand Down
4 changes: 2 additions & 2 deletions haystack/backends/elasticsearch7_backend.py
Expand Up @@ -16,13 +16,13 @@
try:
import elasticsearch

if not ((5, 0, 0) <= elasticsearch.__version__ < (6, 0, 0)):
if not ((7, 0, 0) <= elasticsearch.__version__ < (8, 0, 0)):
raise ImportError
from elasticsearch.helpers import bulk, scan
except ImportError:
raise MissingDependency(
"The 'elasticsearch5' backend requires the \
installation of 'elasticsearch>=5.0.0,<6.0.0'. \
installation of 'elasticsearch>=7.0.0,<8.0.0'. \
Please refer to the documentation."
)

Expand Down
6 changes: 3 additions & 3 deletions test_haystack/elasticsearch7_tests/__init__.py
Expand Up @@ -13,14 +13,14 @@ def setup():
try:
import elasticsearch

if not ((5, 0, 0) <= elasticsearch.__version__ < (6, 0, 0)):
if not ((7, 0, 0) <= elasticsearch.__version__ < (8, 0, 0)):
raise ImportError
from elasticsearch import Elasticsearch, exceptions
except ImportError:
log.error(
"Skipping ElasticSearch 5 tests: 'elasticsearch>=5.0.0,<6.0.0' not installed."
"Skipping ElasticSearch 7 tests: 'elasticsearch>=7.0.0,<8.0.0' not installed."
)
raise unittest.SkipTest("'elasticsearch>=5.0.0,<6.0.0' not installed.")
raise unittest.SkipTest("'elasticsearch>=7.0.0,<8.0.0' not installed.")

url = settings.HAYSTACK_CONNECTIONS["elasticsearch"]["URL"]
es = Elasticsearch(url)
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
@@ -1,8 +1,8 @@
[tox]
envlist =
docs
py35-django2.2-es{1.x,2.x,5.x}
py{36,37,38,py}-django{2.2,3.0}-es{1.x,2.x,5.x}
py35-django2.2-es{1.x,2.x,5.x,7.x}
py{36,37,38,py}-django{2.2,3.0}-es{1.x,2.x,5.x,7.x}


[testenv]
Expand All @@ -16,10 +16,12 @@ deps =
es1.x: elasticsearch>=1,<2
es2.x: elasticsearch>=2,<3
es5.x: elasticsearch>=5,<6
es7.x: elasticsearch>=7,<8
setenv =
es1.x: VERSION_ES=>=1,<2
es2.x: VERSION_ES=>=2,<3
es5.x: VERSION_ES=>=5,<6
es7.x: VERSION_ES=>=7,<8


[testenv:docs]
Expand Down

0 comments on commit 46f1b4e

Please sign in to comment.