Skip to content

Commit

Permalink
Merge pull request #26 from opengisch/ogc-test-suite
Browse files Browse the repository at this point in the history
CI test suite
  • Loading branch information
why-not-try-calmer authored Apr 4, 2023
2 parents 00ed8ff + c816238 commit 97d8bee
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ jobs:
- name: Healthcheck
run: wget --no-check-certificate https://localhost/oapif/collections/signalo_core.pole/items

- name: Run conformance test suite
run: docker compose -f docker-compose.tests.yml up --build conformance_test

- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: emailable-report
path: |
./_test_outputs/**/emailable-report.html
- name: Failure logs
if: failure()
run: docker-compose logs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ __pycache__

static
media
_test_outputs
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ Once up and running, you can use it from QGIS like this:
- Version: `OGC API - Features`
- Click OK and ignore choose to ignore the invalid certificate error and store the exception
- You should see the two layers in the list, select them and choose `add`.

## Run tests

You can run the OGC API conformance test suite like this:

```
docker compose -f docker-compose.tests.yml up --build conformance_test
```

Results will be stored to `_test_outputs\testng\...\emailable-report.html
35 changes: 35 additions & 0 deletions conformance-tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Courtesy of https://github.com/opengeospatial/ets-ogcapi-features10/issues/197

FROM maven:3.8-openjdk-18

# Copy actual source files
ARG VERSION=1.4
RUN git clone --depth 1 --branch ${VERSION} https://github.com/opengeospatial/ets-ogcapi-features10.git /build

WORKDIR /build/

# COPY pom.xml . # checkedout already

RUN mvn --version

# Pre-download all dependencies to increase caching in docker builds
RUN mvn dependency:resolve dependency:resolve-plugins dependency:copy-dependencies dependency:go-offline -Pdocker

# Copy actual source files
# COPY ./src ./src # checkedout already

# Install offline to avoid triggering new dependency update
RUN mvn install -DskipTests -Dmaven.javadoc.skip

# TODO: Should get the version from build context
# ARG VERSION=1.5-SNAPSHOT # done above
ARG OUTPUT_DIR=/build/run/output
ARG TEST_RUN_PROPS=/build/run/test-run-props.xml

ENV VERSION=${VERSION}
ENV OUTPUT_DIR=${OUTPUT_DIR}
ENV TEST_RUN_PROPS=${TEST_RUN_PROPS}

ADD ./test-run-props.xml /build/run/test-run-props.xml

CMD ["sh", "-c", "java -jar /build/target/ets-ogcapi-features10-${VERSION}-aio.jar -o ${OUTPUT_DIR} -h true ${TEST_RUN_PROPS}"]
6 changes: 6 additions & 0 deletions conformance-tests/test-run-props.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties version="1.0">
<comment>Test run arguments</comment>
<entry key="iut">http://django:8000/oapif/</entry>
</properties>
7 changes: 7 additions & 0 deletions docker-compose.tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:

conformance_test:
build: ./conformance-tests
volumes:
- ./_test_outputs:/build/run/output
# - .:/build/run/test-run-props.xml
2 changes: 1 addition & 1 deletion src/signalo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ["localhost"]
ALLOWED_HOSTS = ["localhost", "django"]


# Application definition
Expand Down

0 comments on commit 97d8bee

Please sign in to comment.