Skip to content

Commit

Permalink
* fixing docker file and docker testing docs
Browse files Browse the repository at this point in the history
* fixing geoalchemy deprecations
  • Loading branch information
jokiefer committed Nov 14, 2023
1 parent 8dae849 commit 8309d58
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,8 @@ python -m pytest

To execute tests in Docker:

```
docker build -t pygeofilter/test -f Dockerfile-3.9 .
docker run --rm pygeofilter/test
```bash
docker compose up --build test
```


Expand Down
8 changes: 4 additions & 4 deletions Dockerfile-3.9 → bullseye-3.9.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-buster
FROM python:3.9-bullseye

LABEL description="Test executor"

Expand All @@ -8,6 +8,7 @@ RUN apt-get update --fix-missing \
binutils \
libproj-dev \
gdal-bin \
libgdal-dev \
libsqlite3-mod-spatialite \
spatialite-bin \
&& rm -rf /var/lib/apt/lists/*
Expand All @@ -19,13 +20,12 @@ COPY requirements-test.txt .
COPY requirements-dev.txt .
RUN pip install -r requirements-test.txt
RUN pip install -r requirements-dev.txt
RUN pip install pygdal=="`gdal-config --version`.*"

COPY pygeofilter pygeofilter
COPY tests tests
COPY README.md .
COPY setup.py .
RUN pip install -e .

RUN chmod +x tests/execute-tests.sh

CMD ["tests/execute-tests.sh"]
CMD ["python", "-m", "pytest"]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
version: '3.8'
services:

test:
build:
context: .
dockerfile: bullseye-3.9.Dockerfile
tty: true # To support colorized log output.
networks:
- default
depends_on:
- es01
environment:
- eshostname=es01

es01:
depends_on:
setup:
Expand Down
5 changes: 3 additions & 2 deletions tests/backends/elasticsearch/test_evaluate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pylint: disable=W0621,C0114,C0115,C0116

import os
import pytest
from elasticsearch_dsl import (
Date,
Expand Down Expand Up @@ -53,8 +53,9 @@ class Index:

@pytest.fixture(autouse=True, scope="session")
def connection():
hostname = os.environ.get("eshostname", "localhost")
connections.create_connection(
hosts=["https://localhost:9200"],
hosts=[f"https://{hostname}:9200"],
ca_certs=False,
verify_certs=False,
basic_auth=("elastic", "changeme")
Expand Down
1 change: 0 additions & 1 deletion tests/backends/sqlalchemy/test_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Record(Base):
geometry_type="MULTIPOLYGON",
srid=4326,
spatial_index=False,
management=True,
)
)
float_attribute = Column(Float)
Expand Down

0 comments on commit 8309d58

Please sign in to comment.