Skip to content

Commit 5d77519

Browse files
committed
test against es6,7,8
1 parent 36abe29 commit 5d77519

File tree

4 files changed

+54
-29
lines changed

4 files changed

+54
-29
lines changed

.github/workflows/test_djelme.yml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,46 @@ permissions:
1111
jobs:
1212
lint:
1313
runs-on: ubuntu-latest
14+
container: python:3.7-slim
1415
steps:
1516
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v4
17-
id: setup-py
18-
with:
19-
python-version: '3.7'
20-
- run: pip install -U tox
21-
- name: alias pythonX.Y for tox
22-
run: alias python${{ steps.setup-py.outputs.python-version }}=${{ steps.setup-py.outputs.python-path }}
17+
- run: pip install tox
2318
- run: TOXENV=lint tox
2419

2520

2621
test:
2722
strategy:
2823
matrix:
29-
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
24+
python: ['3.7', '3.8', '3.9', '3.10']
3025
django: ['1.11', '2.0', '2.1', '2.2', '3.0', '3.1', '3.2', '4.0', '4.1']
31-
# TODO: elasticsearch: ['6', '7', '8', '9']
26+
elastic: ['6', '7', '8']
3227
exclude:
33-
- {python: '3.6', django: '4.0'}
34-
- {python: '3.6', django: '4.1'}
3528
- {python: '3.7', django: '4.0'}
3629
- {python: '3.7', django: '4.1'}
3730
- {python: '3.10', django: '1.11'}
3831
- {python: '3.10', django: '2.0'}
3932
runs-on: ubuntu-latest
33+
container: python:${{matrix.python}}-slim
4034
services:
41-
elasticsearch:
42-
image: elasticsearch:6.8.23
43-
ports:
44-
- 9201:9200
35+
elasticsearch6:
36+
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.23
37+
env:
38+
discovery.type: single-node
39+
elasticsearch7:
40+
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.6
41+
env:
42+
discovery.type: single-node
43+
elasticsearch8:
44+
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.1
45+
env:
46+
discovery.type: single-node
47+
ELASTIC_CLIENT_APIVERSIONING: 1 # act like es7
48+
xpack.security.enabled: "false" # it'll be fine
49+
action.destructive_requires_name: "false" # we'll delete * in a moment
50+
env:
51+
ELASTICSEARCH_HOST: elasticsearch${{matrix.elastic}}:9200
4552
steps:
4653
- uses: actions/checkout@v3
47-
- uses: actions/setup-python@v4
48-
id: setup-py
49-
with:
50-
python-version: ${{ matrix.python }}
5154
- run: pip install -U tox
52-
- run: alias python${{ steps.setup-py.outputs.python-version }}=${{ steps.setup-py.outputs.python-path }}
53-
- run: TOXENV=`echo 'py${{ matrix.python }}-django${{matrix.django}}' | sed 's/\.//g'` tox
55+
- run: TOXENV=`echo 'py${{matrix.python}}-django${{matrix.django}}-es${{matrix.elastic}}' | sed 's/\.//g'` tox
5456

docker-compose.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
version: '3'
22
services:
3-
elasticsearch:
4-
image: docker.elastic.co/elasticsearch/elasticsearch:6.3.1
3+
elasticsearch6:
4+
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.23
5+
environment:
6+
discovery.type: single-node
7+
elasticsearch7:
8+
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.6
9+
environment:
10+
discovery.type: single-node
11+
elasticsearch8:
12+
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.1
13+
environment:
14+
discovery.type: single-node
15+
ELASTIC_CLIENT_APIVERSIONING: 1 # act like es7
16+
xpack.security.enabled: "false"
17+
action.destructive_requires_name: "false"
518
testbox:
619
build:
720
context: .
821
dockerfile: testbox.Dockerfile
922
depends_on:
10-
- elasticsearch
23+
# - elasticsearch6
24+
# - elasticsearch7
25+
- elasticsearch8
1126
environment:
12-
TOXENV: py39-django40
13-
ELASTICSEARCH_HOST: elasticsearch:9200
27+
# ELASTICSEARCH_HOST: elasticsearch6:9200
28+
# ELASTICSEARCH_HOST: elasticsearch7:9200
29+
ELASTICSEARCH_HOST: elasticsearch8:9200
1430
volumes:
1531
- ./:/code:cached

testbox.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ WORKDIR /code
55
COPY ./ /code
66

77
RUN pip install .[dev]
8+
RUN pip install Django==3.2.15
89

10+
ENV TOXENV py39-django32-es7
911
CMD ["tox"]

tox.ini

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
[tox]
2+
isolated_build = True
23
envlist =
34
lint
4-
py{36,37,38,39,310}-django{111,20,21,22,30,31,32,40,41}
5+
py{37,38,39,310}-django{111,20,21,22,30,31,32,40,41}-es{6,7}
56

67
[testenv]
7-
passenv=ELASTICSEARCH_HOST
8-
extras = tests
8+
passenv = ELASTICSEARCH_HOST
9+
extras =
10+
dev
11+
es6: es6
12+
es7: es7
13+
es8: es8
914
deps =
1015
django111: Django>=1.11,<1.12
1116
django20: Django>=2.0,<2.1

0 commit comments

Comments
 (0)