kopia lustrzana https://github.com/wagtail/wagtail
Add Elasticsearch 8 to test matrix (but keep using the v7 python library, as a baseline test)
rodzic
3d471edbcf
commit
5e1b12ce32
|
@ -31,7 +31,7 @@ concurrency:
|
|||
# - elasticsearch 5, django 3.2, python 3.8, sqlite
|
||||
# - elasticsearch 6, django 3.2, python 3.8, postgres
|
||||
# - elasticsearch 7, django 4.1, python 3.8, postgres
|
||||
# - elasticsearch 7, django 4.2, python 3.9, sqlite, USE_EMAIL_USER_MODEL=yes
|
||||
# - elasticsearch 8, django 4.2, python 3.10, sqlite, USE_EMAIL_USER_MODEL=yes
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
@ -231,12 +231,12 @@ jobs:
|
|||
name: coverage-data
|
||||
path: .coverage.*
|
||||
|
||||
test-sqlite-elasticsearch7:
|
||||
test-sqlite-elasticsearch8:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- python: '3.9'
|
||||
- python: '3.10'
|
||||
django: 'Django>=4.2,<4.3'
|
||||
emailuser: emailuser
|
||||
steps:
|
||||
|
@ -248,7 +248,7 @@ jobs:
|
|||
sudo sysctl -w vm.max_map_count=262144
|
||||
- uses: getong/elasticsearch-action@v1.2
|
||||
with:
|
||||
elasticsearch version: 7.6.1
|
||||
elasticsearch version: 8.8.0
|
||||
host port: 9200
|
||||
container port: 9200
|
||||
host node port: 9300
|
||||
|
@ -268,7 +268,7 @@ jobs:
|
|||
pip install certifi
|
||||
- name: Test
|
||||
run: |
|
||||
coverage run --parallel-mode --source wagtail runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch7
|
||||
coverage run --parallel-mode --source wagtail runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch8
|
||||
env:
|
||||
DATABASE_ENGINE: django.db.backends.sqlite3
|
||||
USE_EMAIL_USER_MODEL: ${{ matrix.emailuser }}
|
||||
|
@ -398,7 +398,7 @@ jobs:
|
|||
- test-postgres
|
||||
- test-mysql
|
||||
- test-sqlite-elasticsearch5
|
||||
- test-sqlite-elasticsearch7
|
||||
- test-sqlite-elasticsearch8
|
||||
- test-postgres-elasticsearch6
|
||||
- test-postgres-elasticsearch7
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -22,6 +22,7 @@ def make_parser():
|
|||
parser.add_argument("--elasticsearch5", action="store_true")
|
||||
parser.add_argument("--elasticsearch6", action="store_true")
|
||||
parser.add_argument("--elasticsearch7", action="store_true")
|
||||
parser.add_argument("--elasticsearch8", action="store_true")
|
||||
parser.add_argument("--emailuser", action="store_true")
|
||||
parser.add_argument("--disabletimezone", action="store_true")
|
||||
parser.add_argument("--bench", action="store_true")
|
||||
|
@ -69,6 +70,9 @@ def runtests():
|
|||
elif args.elasticsearch7:
|
||||
os.environ.setdefault("ELASTICSEARCH_URL", "http://localhost:9200")
|
||||
os.environ.setdefault("ELASTICSEARCH_VERSION", "7")
|
||||
elif args.elasticsearch8:
|
||||
os.environ.setdefault("ELASTICSEARCH_URL", "http://localhost:9200")
|
||||
os.environ.setdefault("ELASTICSEARCH_VERSION", "8")
|
||||
|
||||
elif "ELASTICSEARCH_URL" in os.environ:
|
||||
# forcibly delete the ELASTICSEARCH_URL setting to skip those tests
|
||||
|
|
5
tox.ini
5
tox.ini
|
@ -2,7 +2,7 @@
|
|||
skipsdist = True
|
||||
usedevelop = True
|
||||
|
||||
envlist = py{38,39,310,311}-dj{32,41,42,42stable,main}-{sqlite,postgres,mysql,mssql}-{elasticsearch7,elasticsearch6,elasticsearch5,noelasticsearch}-{customuser,emailuser}-{tz,notz},
|
||||
envlist = py{38,39,310,311}-dj{32,41,42,42stable,main}-{sqlite,postgres,mysql,mssql}-{elasticsearch8,elasticsearch7,elasticsearch6,elasticsearch5,noelasticsearch}-{customuser,emailuser}-{tz,notz},
|
||||
|
||||
[testenv]
|
||||
install_command = pip install -e ".[testing]" -U {opts} {packages}
|
||||
|
@ -10,6 +10,7 @@ commands =
|
|||
elasticsearch5: coverage run runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch5
|
||||
elasticsearch6: coverage run runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch6
|
||||
elasticsearch7: coverage run runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch7
|
||||
elasticsearch8: coverage run runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch8
|
||||
noelasticsearch: coverage run runtests.py {posargs}
|
||||
|
||||
basepython =
|
||||
|
@ -36,6 +37,8 @@ deps =
|
|||
elasticsearch6: certifi
|
||||
elasticsearch7: elasticsearch>=7,<8
|
||||
elasticsearch7: certifi
|
||||
elasticsearch8: elasticsearch>=7,<8
|
||||
elasticsearch8: certifi
|
||||
|
||||
setenv =
|
||||
postgres: DATABASE_ENGINE=django.db.backends.postgresql
|
||||
|
|
|
@ -204,7 +204,10 @@ if os.environ.get("DATABASE_ENGINE") == "django.db.backends.postgresql":
|
|||
}
|
||||
|
||||
if "ELASTICSEARCH_URL" in os.environ:
|
||||
if os.environ.get("ELASTICSEARCH_VERSION") == "7":
|
||||
if os.environ.get("ELASTICSEARCH_VERSION") == "8":
|
||||
# for now, use the 7 backend for ES8
|
||||
backend = "wagtail.search.backends.elasticsearch7"
|
||||
elif os.environ.get("ELASTICSEARCH_VERSION") == "7":
|
||||
backend = "wagtail.search.backends.elasticsearch7"
|
||||
elif os.environ.get("ELASTICSEARCH_VERSION") == "6":
|
||||
backend = "wagtail.search.backends.elasticsearch6"
|
||||
|
|
Ładowanie…
Reference in New Issue