Skip to content

Docker image for running tests via CLI #197

Open

Description

@jnystad

Is your feature request related to a problem? Please describe.
The docker image provided is built to run the full TEAM Engine server, but this is not necessarily the easiest way for non-java developers to get access to this test suite.

Describe the solution you'd like
It would be great if you provided a docker image that was rigged for the CLI invocation only.

Additional context

A Dockerfile I created to make this image myself that tries to do some build phases for quicker development iteration:

FROM maven:3.8-openjdk-18

WORKDIR /build/

COPY pom.xml .

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

# 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
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}

CMD ["sh", "-c", "java -jar /build/target/ets-ogcapi-features10-${VERSION}-aio.jar -o ${OUTPUT_DIR} -h true ${TEST_RUN_PROPS}"]

I'm not a Java developer, so this may or may not be a good approach, but it works OK for me.

Invocation example:

docker container run --mount type=bind,source=/path/to/run,target=/build/run image-name

Note the required bound mount to pass test-run-props.xml in, and get the resulting output written to local directory.

It should probably be optimized to copy the built artifacts to a new runtime image to reduce the size of the produced image.

Activity

  1. dstenger commented on Sep 1, 2022

    @dstenger
    Contributor

    Thank you for providing this feature request.

    A similar idea was already documented here: opengeospatial/teamengine-docker#39

    We will discuss this in the CITE team.

  2. moved this to Needs discussion in CITEon Aug 1, 2024
  3. ghobona commented on Sep 29, 2025

    @ghobona

    Thanks for sharing the approach. Several alternative approaches have been proposed and demonstrated on how to integrate TEAM Engine or the Executable Test Suites into DevOps workflows through custom Dockerfile configurations. We have focused on one specific approach but do encourage the community to develop and share alternative approaches. We have linked your post to the Developer Guidance Wiki to share the approach with the wider community https://github.com/opengeospatial/cite/wiki#developer-community-resources

  4. moved this from Needs discussion to In progress in CITEon Sep 29, 2025
  5. moved this from In progress to Waiting in CITEon Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

  • Status
    Waiting

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions