Skip to content

Commit

Permalink
test against es6,7,8
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Sep 9, 2022
1 parent 36abe29 commit 5d77519
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 29 deletions.
44 changes: 23 additions & 21 deletions .github/workflows/test_djelme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,46 @@ permissions:
jobs:
lint:
runs-on: ubuntu-latest
container: python:3.7-slim
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: setup-py
with:
python-version: '3.7'
- run: pip install -U tox
- name: alias pythonX.Y for tox
run: alias python${{ steps.setup-py.outputs.python-version }}=${{ steps.setup-py.outputs.python-path }}
- run: pip install tox
- run: TOXENV=lint tox


test:
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
python: ['3.7', '3.8', '3.9', '3.10']
django: ['1.11', '2.0', '2.1', '2.2', '3.0', '3.1', '3.2', '4.0', '4.1']
# TODO: elasticsearch: ['6', '7', '8', '9']
elastic: ['6', '7', '8']
exclude:
- {python: '3.6', django: '4.0'}
- {python: '3.6', django: '4.1'}
- {python: '3.7', django: '4.0'}
- {python: '3.7', django: '4.1'}
- {python: '3.10', django: '1.11'}
- {python: '3.10', django: '2.0'}
runs-on: ubuntu-latest
container: python:${{matrix.python}}-slim
services:
elasticsearch:
image: elasticsearch:6.8.23
ports:
- 9201:9200
elasticsearch6:
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.23
env:
discovery.type: single-node
elasticsearch7:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.6
env:
discovery.type: single-node
elasticsearch8:
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.1
env:
discovery.type: single-node
ELASTIC_CLIENT_APIVERSIONING: 1 # act like es7
xpack.security.enabled: "false" # it'll be fine
action.destructive_requires_name: "false" # we'll delete * in a moment
env:
ELASTICSEARCH_HOST: elasticsearch${{matrix.elastic}}:9200
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: setup-py
with:
python-version: ${{ matrix.python }}
- run: pip install -U tox
- run: alias python${{ steps.setup-py.outputs.python-version }}=${{ steps.setup-py.outputs.python-path }}
- run: TOXENV=`echo 'py${{ matrix.python }}-django${{matrix.django}}' | sed 's/\.//g'` tox
- run: TOXENV=`echo 'py${{matrix.python}}-django${{matrix.django}}-es${{matrix.elastic}}' | sed 's/\.//g'` tox

26 changes: 21 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.3.1
elasticsearch6:
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.23
environment:
discovery.type: single-node
elasticsearch7:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.6
environment:
discovery.type: single-node
elasticsearch8:
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.1
environment:
discovery.type: single-node
ELASTIC_CLIENT_APIVERSIONING: 1 # act like es7
xpack.security.enabled: "false"
action.destructive_requires_name: "false"
testbox:
build:
context: .
dockerfile: testbox.Dockerfile
depends_on:
- elasticsearch
# - elasticsearch6
# - elasticsearch7
- elasticsearch8
environment:
TOXENV: py39-django40
ELASTICSEARCH_HOST: elasticsearch:9200
# ELASTICSEARCH_HOST: elasticsearch6:9200
# ELASTICSEARCH_HOST: elasticsearch7:9200
ELASTICSEARCH_HOST: elasticsearch8:9200
volumes:
- ./:/code:cached
2 changes: 2 additions & 0 deletions testbox.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ WORKDIR /code
COPY ./ /code

RUN pip install .[dev]
RUN pip install Django==3.2.15

ENV TOXENV py39-django32-es7
CMD ["tox"]
11 changes: 8 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
[tox]
isolated_build = True
envlist =
lint
py{36,37,38,39,310}-django{111,20,21,22,30,31,32,40,41}
py{37,38,39,310}-django{111,20,21,22,30,31,32,40,41}-es{6,7}

[testenv]
passenv=ELASTICSEARCH_HOST
extras = tests
passenv = ELASTICSEARCH_HOST
extras =
dev
es6: es6
es7: es7
es8: es8
deps =
django111: Django>=1.11,<1.12
django20: Django>=2.0,<2.1
Expand Down

0 comments on commit 5d77519

Please sign in to comment.